on xenial help sign in
Allow pulling manage dash if there's no favorite scopes

Fixes: #1400774 Approved by: Michael Zanetti

commit3d1838060f72156ae85346ccc369bdff39741725 authorAlbert Astals <albert.astals@canonical.com> dateThu 11 Dec 2014, 13:24 (12 years ago) parentc62b60360b3ed0
2 files changed+21−3
qml/Dash/Dash.qml+2−3 tests/qmltests/Dash/tst_Dash.qml+19
qml/Dash/Dash.qml+2−3
@@ -304,7 +304,7 @@ Showable {
304304 Image {
305305 source: "graphics/overview_hint.png"
306306 anchors.horizontalCenter: parent.horizontalCenter
307− opacity: (scopeItem.scope ? scopeItem.pageHeaderTotallyVisible : dashContent.pageHeaderTotallyVisible) &&
307+ opacity: (scopeItem.scope ? scopeItem.pageHeaderTotallyVisible : scopes.count == 0 || dashContent.pageHeaderTotallyVisible) &&
308308 (overviewDragHandle.enabled || bottomEdgeController.progress != 0) ? 1 : 0
309309 Behavior on opacity {
310310 enabled: bottomEdgeController.progress == 0
@@ -324,8 +324,7 @@ Showable {
324324 z: 1
325325 direction: Direction.Upwards
326326 enabled: !dashContent.subPageShown &&
327− dashContent.currentScope &&
328− dashContent.currentScope.searchQuery == "" &&
327+ (scopes.count == 0 || (dashContent.currentScope && dashContent.currentScope.searchQuery == "")) &&
329328 !scopeItem.scope &&
330329 (bottomEdgeController.progress == 0 || dragging)
331330
tests/qmltests/Dash/tst_Dash.qml+19
@@ -214,6 +214,25 @@ Item {
214214 compare(dashContentList.currentIndex, 0);
215215 }
216216
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+
217236 function test_setCurrentScope() {
218237 var dashContentList = findChild(dash, "dashContentList");
219238 var startX = dash.width - units.gu(1);