on xenial help sign in
Allow pulling manage dash if there's no favorite scopes
3d18380Albert Astals
qml/Dash/Dash.qml+2−3
@@ -304,7 +304,7 @@ Showable {
304 Image {
304 Image {
305 source: "graphics/overview_hint.png"
305 source: "graphics/overview_hint.png"
306 anchors.horizontalCenter: parent.horizontalCenter
306 anchors.horizontalCenter: parent.horizontalCenter
307− opacity: (scopeItem.scope ? scopeItem.pageHeaderTotallyVisible : dashContent.pageHeaderTotallyVisible) &&
307+ opacity: (scopeItem.scope ? scopeItem.pageHeaderTotallyVisible : scopes.count == 0 || dashContent.pageHeaderTotallyVisible) &&
308 (overviewDragHandle.enabled || bottomEdgeController.progress != 0) ? 1 : 0
308 (overviewDragHandle.enabled || bottomEdgeController.progress != 0) ? 1 : 0
309 Behavior on opacity {
309 Behavior on opacity {
310 enabled: bottomEdgeController.progress == 0
310 enabled: bottomEdgeController.progress == 0
@@ -324,8 +324,7 @@ Showable {
324 z: 1
324 z: 1
325 direction: Direction.Upwards
325 direction: Direction.Upwards
326 enabled: !dashContent.subPageShown &&
326 enabled: !dashContent.subPageShown &&
327− dashContent.currentScope &&
328− dashContent.currentScope.searchQuery == "" &&
327+ (scopes.count == 0 || (dashContent.currentScope && dashContent.currentScope.searchQuery == "")) &&
329 !scopeItem.scope &&
328 !scopeItem.scope &&
330 (bottomEdgeController.progress == 0 || dragging)
329 (bottomEdgeController.progress == 0 || dragging)
331
330
tests/qmltests/Dash/tst_Dash.qml+19
@@ -214,6 +214,25 @@ Item {
214 compare(dashContentList.currentIndex, 0);
214 compare(dashContentList.currentIndex, 0);
215 }
215 }
216
216
217+ function test_manage_dash_open_no_favorites() {
218+ // Make it so there are no scopes
219+ scopes.clear();
220+ var dashContentList = findChild(dash, "dashContentList");
221+ tryCompare(dashContentList, "count", 0);
222+
223+ // Show the manage dash
224+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
225+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
226+ tryCompare(bottomEdgeController, "progress", 1);
227+
228+ // Go back
229+ var scopesList = findChild(dash, "scopesList");
230+ var scopesListPageHeader = findChild(scopesList, "pageHeader");
231+ var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "backButton");
232+ mouseClick(backButton, 0, 0);
233+ tryCompare(bottomEdgeController, "progress", 0);
234+ }
235+
217 function test_setCurrentScope() {
236 function test_setCurrentScope() {
218 var dashContentList = findChild(dash, "dashContentList");
237 var dashContentList = findChild(dash, "dashContentList");
219 var startX = dash.width - units.gu(1);
238 var startX = dash.width - units.gu(1);