on xenial help sign in
reset after completely messing up merging
commite390a84145c084985994a1229849eb2144648794 authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 30 Sep 2013, 14:17 (13 years ago) parenta5a966b
12 files changed+281−74
Components/Carousel.qml+19−6 Components/FilterGrid.qml+3 Components/ResponsiveGridView.qml+3 Components/Tile.qml+6 Dash/Apps/AppPreview.qml+9 Dash/DashPreview.qml+2−2 Dash/DashPreviewPlaceholder.qml+25 Dash/Generic/GenericFilterGrid.qml+4−6 Dash/GenericScopeView.qml+200−54 Dash/SearchableResultModel.qml+4 Dash/graphics/tooltip_arrow@27.png tests/qmltests/Dash/tst_GenericScopeView.qml+6−6
Components/Carousel.qml+19−6
@@ -45,18 +45,24 @@ Item {
4545 property int drawBuffer: width / pathItemCount // an "ok" value - but values used from the listView cause loops
4646 /// The selected item can be shown in a different size controlled by selectedItemScaleFactor
4747 property real selectedItemScaleFactor: 1.1
48+ /// The index of the item that should be highlighted
49+ property alias highlightIndex: listView.highlightIndex
50+ /// The column count is required for API compatibility with FilterGrids
51+ readonly property int columns: listView.count
52+ /// Indicates that this component automatically centers the highlighted item
53+ readonly property bool highlightCentered: true
4854
4955 /// Emitted when the user clicked on an item
5056 /// @param index is the index of the clicked item
51− /// @param delegateItem is the clicked component/delegate itself
57+ /// @param model is the model of all the items in the carousel
5258 /// @param itemY is y of the clicked delegate
53− signal clicked(int index, var delegateItem, real itemY)
59+ signal clicked(int index, var model, real itemY)
5460
5561 /// Emitted when the user pressed and held on an item
5662 /// @param index is the index of the held item
57− /// @param delegateItem is the held component/delegate itself
63+ /// @param model is the model of all the items in the carousel
5864 /// @param itemY is y of the held delegate
59− signal pressAndHold(int index, var delegateItem, real itemY)
65+ signal pressAndHold(int index, var model, real itemY)
6066
6167 implicitHeight: listView.tileHeight * selectedItemScaleFactor
6268
@@ -75,6 +81,7 @@ Item {
7581 property real newContentX: -1
7682 property real pathItemCount: referenceWidth / referenceTileWidth
7783 property real tileAspectRatio: 1
84+ property int highlightIndex: -1
7885
7986 /* The positioning and scaling of the items in the carousel is based on the variable
8087 'continuousIndex', a continuous real variable between [0, 'carousel.model.count'],
@@ -140,6 +147,11 @@ Item {
140147 flickDeceleration: Math.max(1500 * Math.pow(realWidth / referenceWidth, 1.5), 1500) // 1500 is platform default
141148 maximumFlickVelocity: Math.max(2500 * Math.pow(realWidth / referenceWidth, 1.5), 2500) // 2500 is platform default
142149 orientation: ListView.Horizontal
150+ currentIndex: highlightIndex
151+ highlightFollowsCurrentItem: true
152+ preferredHighlightBegin: (width - tileWidth) * 0.5
153+ preferredHighlightEnd: (width - tileWidth) * 0.5
154+ highlightRangeMode: highlightIndex != -1 ? ListView.StrictlyEnforceRange : ListView.NoHighlightRange
143155
144156 function itemClicked(index, delegateItem) {
145157 var x = CarouselJS.getXFromContinuousIndex(index,
@@ -154,7 +166,7 @@ Item {
154166 /* We're clicking the selected item and
155167 we're in the neighbourhood of radius 1 pixel from it.
156168 Let's emit the clicked signal. */
157− carousel.clicked(index, delegateItem, delegateItem.y)
169+ carousel.clicked(index, listView.model, delegateItem.y)
158170 return
159171 }
160172
@@ -178,7 +190,7 @@ Item {
178190 /* We're pressAndHold the selected item and
179191 we're in the neighbourhood of radius 1 pixel from it.
180192 Let's emit the pressAndHold signal. */
181− carousel.pressAndHold(index, delegateItem, delegateItem.y);
193+ carousel.pressAndHold(index, listView.model, delegateItem.y);
182194 return;
183195 }
184196
@@ -277,6 +289,7 @@ Item {
277289 scale: itemScale * explicitScaleFactor
278290 sourceComponent: itemComponent
279291 z: cachedTiles - Math.abs(index - listView.selectedIndex)
292+ opacity: highlightIndex == -1 ? 1 : (highlightIndex == index ? 0.6 : 0.2)
280293
281294 transform: Translate {
282295 x: listView.viewTranslation + translationX * listView.scaleFactor
Components/FilterGrid.qml+3
@@ -54,12 +54,15 @@ Item {
5454 property alias delegateWidth: iconTileGrid.delegateWidth
5555 property alias delegateHeight: iconTileGrid.delegateHeight
5656 property alias verticalSpacing: iconTileGrid.verticalSpacing
57+ readonly property alias margins: iconTileGrid.margins
5758 property alias delegate: iconTileGrid.delegate
5859 property alias cellWidth: iconTileGrid.cellWidth
5960 property alias cellHeight: iconTileGrid.cellHeight
6061 readonly property alias flicking: iconTileGrid.flicking
6162 readonly property alias moving: iconTileGrid.moving
6263 readonly property alias pressDelay: iconTileGrid.pressDelay
64+ property alias highlightIndex: iconTileGrid.highlightIndex
65+ readonly property bool highlightCentered: false
6366
6467 height: !filterAnimation.running ? childrenRect.height : height
6568 clip: filterAnimation.running
Components/ResponsiveGridView.qml+3
@@ -26,6 +26,7 @@ Item {
2626 property int maximumNumberOfColumns: 6
2727 readonly property int columns: gridView.columns
2828 property alias verticalSpacing: gridView.verticalSpacing
29+ readonly property alias margins: gridView.margin
2930 property int delegateWidth
3031 property int delegateHeight
3132 property alias model: gridView.model
@@ -39,6 +40,7 @@ Item {
3940 readonly property alias flicking: gridView.flicking
4041 readonly property alias moving: gridView.moving
4142 readonly property alias pressDelay: gridView.pressDelay
43+ property alias highlightIndex: gridView.highlightIndex
4244
4345 function contentHeightForRows(rows) {
4446 return rows * cellHeight + verticalSpacing
@@ -54,6 +56,7 @@ Item {
5456 topMargin: verticalSpacing
5557 }
5658 clip: parent.height != totalContentHeight
59+ property int highlightIndex: -1
5760
5861 function pixelToGU(value) {
5962 return Math.floor(value / units.gu(1));
Components/Tile.qml+6
@@ -26,6 +26,12 @@ AbstractButton {
2626 property alias text: label.text
2727 property int imageWidth
2828 property int imageHeight
29+ opacity: GridView.view.highlightIndex === -1 ? 1 :
30+ GridView.view.highlightIndex === index ? 0.6 : 0.2
31+
32+ Behavior on opacity {
33+ UbuntuNumberAnimation {}
34+ }
2935
3036 UbuntuShape {
3137 id: icon
Dash/Apps/AppPreview.qml+9
@@ -39,6 +39,15 @@ DashPreview {
3939 }
4040 model: previewData.infoMap["more-screenshots"] != null ? previewData.infoMap["more-screenshots"].value : [previewData.image]
4141
42+ // FIXME: Because of ListViews inside ListViews inside Flickables inside ListViews (and some more)
43+ // we finally reached the point where this ListView doesn't correctly get swipe input any more but
44+ // instead the parent ListView is the one that is swiped. This MouseArea sort of creates a blocking
45+ // layer to make sure this ListView can be swiped, regardless of what's behind it.
46+ MouseArea {
47+ anchors.fill: parent
48+ enabled: parent.contentWidth > parent.width
49+ }
50+
4251 delegate: UbuntuShape {
4352 id: shape
4453 anchors {
Dash/DashPreview.qml+2−2
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919
20−Rectangle {
20+Item {
2121 id: root
2222
2323 property int keyboardSize: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
@@ -36,7 +36,6 @@ Rectangle {
3636 signal close()
3737 signal previewImageClicked()
3838
39− color: Qt.rgba(0, 0, 0, .3)
4039 clip: true
4140
4241 function ensureVisible(item) {
@@ -119,6 +118,7 @@ Rectangle {
119118 left: parent.left
120119 leftMargin: title.paintedWidth + labelItem.spacing
121120 }
121+ visible: title.text !== ""
122122 }
123123 }
124124 }
Dash/DashPreviewPlaceholder.qmlnew file+25
@@ -0,0 +1,25 @@
1+/*
2+ * Copyright (C) 2013 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import Ubuntu.Components 0.1
19+
20+DashPreview {
21+ ActivityIndicator {
22+ anchors.centerIn: parent
23+ running: true
24+ }
25+}
Dash/Generic/GenericFilterGrid.qml+4−6
@@ -28,8 +28,8 @@ FilterGrid {
2828 property int iconWidth: units.gu(8)
2929 property int iconHeight: units.gu(7.5)
3030
31− signal clicked(int index, var delegateItem, real itemY)
32− signal pressAndHold(int index, var delegateItem, real itemY)
31+ signal clicked(int index, var model, real itemY)
32+ signal pressAndHold(int index, var model, real itemY)
3333
3434 delegate: Tile {
3535 id: tile
@@ -45,13 +45,11 @@ FilterGrid {
4545 fillMode: Image.PreserveAspectCrop
4646
4747 onClicked: {
48− var data = { model: model }
49− filtergrid.clicked(index, data, tile.y)
48+ filtergrid.clicked(index, filtergrid.model, tile.y)
5049 }
5150
5251 onPressAndHold: {
53− var data = { model: model }
54− filtergrid.pressAndHold(index, data, tile.y)
52+ filtergrid.pressAndHold(index, filtergrid.model, tile.y)
5553 }
5654 }
5755}
Dash/GenericScopeView.qml+200−54
@@ -21,11 +21,11 @@ import "../Components/ListItems" as ListItems
2121
2222ScopeView {
2323 id: scopeView
24− readonly property alias previewShown: previewLoader.onScreen
24+ readonly property alias previewShown: previewListView.onScreen
2525
2626 onIsCurrentChanged: {
2727 pageHeader.resetSearch();
28− previewLoader.open = false;
28+ previewListView.open = false;
2929 }
3030
3131 onMovementStarted: categoryView.showHeader()
@@ -52,22 +52,29 @@ ScopeView {
5252
5353 Connections {
5454 target: scopeView.scope
55− onShowDash: previewLoader.open = false;
56− onHideDash: previewLoader.open = false;
55+ onShowDash: previewListView.open = false;
56+ onHideDash: previewListView.open = false;
5757 }
5858
5959 ScopeListView {
6060 id: categoryView
6161 anchors.fill: parent
6262 model: scopeView.categories
63− forceNoClip: previewLoader.onScreen
63+ forceNoClip: previewListView.onScreen
6464
6565 onAtYEndChanged: if (atYEnd) endReached()
6666 onMovingChanged: if (moving && atYEnd) endReached()
6767
6868 property string expandedCategoryId: ""
69+ signal correctExpandedCategory();
70+
71+ Behavior on contentY {
72+ enabled: previewListView.open
73+ UbuntuNumberAnimation {}
74+ }
6975
7076 delegate: ListItems.Base {
77+ id: rendererDelegate
7178 highlightWhenPressed: false
7279
7380 readonly property bool expandable: rendererLoader.item ? rendererLoader.item.expandable : false
@@ -104,33 +111,50 @@ ScopeView {
104111 Connections {
105112 target: rendererLoader.item
106113 onClicked: {
114+ // Prepare the preview in case activate() triggers a preview only
107115 effect.positionPx = mapToItem(categoryView, 0, itemY).y
108− scopeView.scope.activate(delegateItem.model.uri,
109− delegateItem.model.icon,
110− delegateItem.model.category,
111− 0,
112− delegateItem.model.mimetype,
113− delegateItem.model.title,
114− delegateItem.model.comment,
115− delegateItem.model.dndUri,
116− delegateItem.model.metadata)
116+ previewListView.categoryId = categoryId
117+ previewListView.categoryDelegate = rendererLoader.item
118+ previewListView.model = model;
119+ previewListView.init = true;
120+ previewListView.currentIndex = index;
121+
122+ var item = model.get(index);
123+
124+ if ((scopeView.scope.id == "applications.scope" && categoryId == "installed")
125+ || (scopeView.scope.id == "home.scope" && categoryId == "applications.scope")) {
126+ scopeView.scope.activate(item.uri, item.icon, item.category, 0, item.mimetype, item.title,
127+ item.comment, item.dndUri, item.metadata)
128+ } else {
129+ previewListView.open = true
130+
131+ scopeView.scope.preview( item.uri, item.icon, item.category, 0, item.mimetype, item.title,
132+ item.comment, item.dndUri, item.metadata)
133+ }
117134 }
118135 onPressAndHold: {
119136 effect.positionPx = mapToItem(categoryView, 0, itemY).y
120− scopeView.scope.preview( delegateItem.model.uri,
121− delegateItem.model.icon,
122− delegateItem.model.category,
123− 0,
124− delegateItem.model.mimetype,
125− delegateItem.model.title,
126− delegateItem.model.comment,
127− delegateItem.model.dndUri,
128− delegateItem.model.metadata)
137+ previewListView.categoryId = categoryId
138+ previewListView.categoryDelegate = rendererLoader.item
139+ previewListView.model = model;
140+ previewListView.init = true;
141+ previewListView.currentIndex = index;
142+ previewListView.open = true
143+
144+ var item = model.get(index)
145+ scopeView.scope.preview( item.uri, item.icon, item.category, 0, item.mimetype, item.title,
146+ item.comment, item.dndUri, item.metadata)
129147 }
130148 }
131149 Connections {
132150 target: categoryView
133151 onExpandedCategoryIdChanged: {
152+ collapseAllButExpandedCategory();
153+ }
154+ onCorrectExpandedCategory: {
155+ collapseAllButExpandedCategory();
156+ }
157+ function collapseAllButExpandedCategory() {
134158 var item = rendererLoader.item;
135159 if (item.expandable) {
136160 var shouldFilter = categoryId != categoryView.expandedCategoryId;
@@ -138,13 +162,15 @@ ScopeView {
138162 // If the filter animation will be seen start it, otherwise, just flip the switch
139163 var shrinkingVisible = shouldFilter && y + item.collapsedHeight < categoryView.height;
140164 var growingVisible = !shouldFilter && y + height < categoryView.height;
141− if (shrinkingVisible || growingVisible) {
142− item.startFilterAnimation(shouldFilter)
143− } else {
144− item.filter = shouldFilter;
145− }
146− if (!shouldFilter) {
147− categoryView.maximizeVisibleArea(index, item.uncollapsedHeight);
165+ if (!previewListView.open || !shouldFilter) {
166+ if (shrinkingVisible || growingVisible) {
167+ item.startFilterAnimation(shouldFilter)
168+ } else {
169+ item.filter = shouldFilter;
170+ }
171+ if (!shouldFilter && !previewListView.open) {
172+ categoryView.maximizeVisibleArea(index, item.uncollapsedHeight);
173+ }
148174 }
149175 }
150176 }
@@ -222,18 +248,18 @@ ScopeView {
222248 topOpacity: (1 - gap * 1.2)
223249 bottomGapPx: positionPx + gap * (targetBottomGapPx - positionPx)
224250 bottomOverflow: units.gu(20)
225− bottomOpacity: 1 - (gap * 0.8)
251+ live: true
226252
227253 property int targetBottomGapPx: height - units.gu(8) - bottomOverflow
228− property real gap: previewLoader.open ? 1.0 : 0.0
254+ property real gap: previewListView.open ? 1.0 : 0.0
229255
230256 Behavior on gap {
231257 NumberAnimation {
232258 duration: 200
233259 easing.type: Easing.InOutQuad
234260 onRunningChanged: {
235− if (!previewLoader.open && !running) {
236− previewLoader.onScreen = false
261+ if (!previewListView.open && !running) {
262+ previewListView.onScreen = false
237263 }
238264 }
239265 }
@@ -243,8 +269,18 @@ ScopeView {
243269 Connections {
244270 target: scopeView.scope
245271 onPreviewReady: {
246− previewLoader.previewData = preview
247− previewLoader.open = true
272+ if (previewListView.init) {
273+ // Preview was triggered because of a click on the item. Need to expand now.
274+ if (!previewListView.open) {
275+ previewListView.open = true
276+ }
277+
278+ var index = previewListView.currentIndex
279+ previewListView.currentIndex = -1
280+ previewListView.currentIndex = index
281+ previewListView.init = false
282+ }
283+ previewListView.currentItem.previewData = preview
248284 }
249285 }
250286
@@ -252,18 +288,9 @@ ScopeView {
252288 id: previewDelegateMapper
253289 }
254290
255− Connections {
256− ignoreUnknownSignals: true
257− target: previewLoader.valid ? previewLoader.item : null
258− onClose: {
259− previewLoader.open = false
260− }
261− }
262−
263− Loader {
264− objectName: "previewLoader"
265− id: previewLoader
266− property var previewData
291+ ListView {
292+ id: previewListView
293+ objectName: "previewListView"
267294 height: effect.bottomGapPx - effect.topGapPx
268295 anchors {
269296 top: parent.top
@@ -271,32 +298,151 @@ ScopeView {
271298 left: parent.left
272299 right: parent.right
273300 }
274− source: onScreen ? previewDelegateMapper.map(previewLoader.previewData.rendererName) : ""
301+ orientation: ListView.Horizontal
302+ highlightRangeMode: ListView.StrictlyEnforceRange
303+ snapMode: ListView.SnapOneItem
304+ boundsBehavior: Flickable.DragAndOvershootBounds
305+ highlightMoveDuration: 250
306+ flickDeceleration: units.gu(625)
307+ maximumFlickVelocity: width * 5
308+ cacheBuffer: 0
309+
310+ // To be set before opening the preview
311+ property string categoryId: ""
312+ property var categoryDelegate
313+
314+ // because the ListView is built asynchronous, setting the
315+ // currentIndex directly won't work. We need to refresh it
316+ // when the first preview is ready to be displayed.
317+ property bool init: true
318+
319+ // Used internally
320+ property int oldRow: -1
321+ property bool categoryWasFiltered: false
322+ property int initialContenY: 0
323+
324+ onCurrentIndexChanged: {
325+ var row = Math.floor(currentIndex / categoryDelegate.columns);
326+ if (!init && model !== undefined) {
327+ var item = model.get(currentIndex)
328+ scopeView.scope.preview( item.uri, item.icon, item.category, 0, item.mimetype, item.title, item.comment, item.dndUri, item.metadata)
329+ if (oldRow != -1) {
330+ if (row < oldRow) {
331+ categoryView.contentY -= categoryDelegate.cellHeight
332+ } else if (row > oldRow){
333+ categoryView.contentY += categoryDelegate.cellHeight
334+ }
335+ }
336+ }
337+ oldRow = row;
338+ if (categoryDelegate.collapsedRowCount <= row) {
339+ categoryView.expandedCategoryId = categoryId
340+ }
341+
342+ if (open) {
343+ categoryDelegate.highlightIndex = currentIndex
344+ }
345+ }
275346
276347 property bool open: false
277348 property bool onScreen: false
278− property bool valid: item !== null
279349
280350 onOpenChanged: {
281351 if (open) {
282352 onScreen = true
353+ categoryDelegate.highlightIndex = currentIndex
354+ } else {
355+ model = undefined
356+ categoryView.correctExpandedCategory();
357+ categoryDelegate.highlightIndex = -1
283358 }
284359 }
285360
286− onLoaded: {
287− item.previewData = Qt.binding(function() { return previewLoader.previewData })
361+ Rectangle {
362+ anchors.fill: parent
363+ color: Qt.rgba(0, 0, 0, .3)
364+ }
365+
366+ delegate: Loader {
367+ id: previewLoader
368+ objectName: "previewLoader"
369+ height: previewListView.height
370+ width: previewListView.width
371+ asynchronous: true
372+ source: previewListView.onScreen ?
373+ (previewData !== undefined ? previewDelegateMapper.map(previewData.rendererName) : "DashPreviewPlaceholder.qml") : ""
374+
375+ onPreviewDataChanged: {
376+ if (previewData !== undefined && source.toString().indexOf("DashPreviewPlaceholder.qml") != -1) {
377+ previewLoader.opacity = 0;
378+ }
379+ }
380+
381+ onSourceChanged: {
382+ if (previewData !== undefined) {
383+ fadeIn.start()
384+ }
385+ }
386+
387+ PropertyAnimation {
388+ id: fadeIn
389+ target: previewLoader
390+ property: "opacity"
391+ from: 0.0
392+ to: 1.0
393+ duration: UbuntuAnimation.BriskDuration
394+ }
395+
396+ property var previewData
397+ property bool valid: item !== null
398+
399+ onLoaded: {
400+ if (previewListView.onScreen && previewData !== undefined) {
401+ item.previewData = Qt.binding(function() { return previewData })
402+ }
403+ }
404+
405+ Connections {
406+ ignoreUnknownSignals: true
407+ target: item
408+ onClose: {
409+ previewListView.open = false
410+ }
411+ }
412+ }
413+ }
414+
415+ Image {
416+ anchors {
417+ top: previewListView.bottom
418+ left: parent.left
419+ leftMargin: previewListView.categoryDelegate.highlightCentered ?
420+ (parent.width - width) / 2 :
421+ (highlightColumn * cellWidth) + (-width + cellWidth + margins) / 2
422+ Behavior on leftMargin {
423+ UbuntuNumberAnimation {}
424+ }
288425 }
426+ height: units.gu(1)
427+ width: units.gu(2)
428+ property int columns: previewListView.categoryDelegate ? previewListView.categoryDelegate.columns : 1
429+ property int highlightColumn: previewListView.currentIndex % columns
430+ property int cellWidth: previewListView.categoryDelegate ? previewListView.categoryDelegate.cellWidth : 0
431+ property int margins: previewListView.categoryDelegate ? previewListView.categoryDelegate.margins : 0
432+ opacity: previewListView.open ? .5 : 0
433+
434+ source: "graphics/tooltip_arrow.png"
289435 }
290436
291437 // TODO: Move as InverseMouseArea to DashPreview
292438 MouseArea {
293− enabled: previewLoader.onScreen
439+ enabled: previewListView.onScreen
294440 anchors {
295441 fill: parent
296442 topMargin: effect.bottomGapPx
297443 }
298444 onClicked: {
299− previewLoader.open = false;
445+ previewListView.open = false;
300446 }
301447 }
302448}
Dash/SearchableResultModel.qml+4
@@ -25,6 +25,10 @@ SortFilterProxyModel {
2525
2626 filterRole: CategoryResults.RoleTitle
2727
28+ function get(index) {
29+ return model.get(mapToSource(index))
30+ }
31+
2832 onSearchQueryChanged: {
2933 if (searchQuery.length == 0) {
3034 filterRegExp = RegExp("");
Dash/graphics/tooltip_arrow@27.pngnew file

Binary file not shown.

tests/qmltests/Dash/tst_GenericScopeView.qml+6−6
@@ -44,25 +44,25 @@ Item {
4444
4545 function test_isCurrent() {
4646 var pageHeader = findChild(genericScopeView, "pageHeader");
47− var previewLoader = findChild(genericScopeView, "previewLoader");
47+ var previewListView = findChild(genericScopeView, "previewListView");
4848 genericScopeView.isCurrent = true
4949 pageHeader.searchQuery = "test"
50− previewLoader.open = true
50+ previewListView.open = true
5151 genericScopeView.isCurrent = false
5252 tryCompare(pageHeader, "searchQuery", "")
5353 tryCompare(genericScopeView, "previewShown", false);
5454 }
5555
5656 function test_showDash() {
57− var previewLoader = findChild(genericScopeView, "previewLoader");
58− previewLoader.open = true;
57+ var previewListView = findChild(genericScopeView, "previewListView");
58+ previewListView.open = true;
5959 scopes.get(0).showDash();
6060 tryCompare(genericScopeView, "previewShown", false);
6161 }
6262
6363 function test_hideDash() {
64− var previewLoader = findChild(genericScopeView, "previewLoader");
65− previewLoader.open = true;
64+ var previewListView = findChild(genericScopeView, "previewListView");
65+ previewListView.open = true;
6666 scopes.get(0).hideDash();
6767 tryCompare(genericScopeView, "previewShown", false);
6868 }