on xenial help sign in
makes left swip reset the search string. Fixes: #1413791
f92e7achandsome_feng
qml/Dash/Dash.qml+1−1
@@ -41,7 +41,7 @@ Showable {
41 onSetCurrentScopeRequested: {
41 onSetCurrentScopeRequested: {
42 if (!isSwipe || !window.active || bottomEdgeController.progress != 0 || scopeItem.scope || dashContent.subPageShown) {
42 if (!isSwipe || !window.active || bottomEdgeController.progress != 0 || scopeItem.scope || dashContent.subPageShown) {
43 if (bottomEdgeController.progress != 0 && window.active) animate = false;
43 if (bottomEdgeController.progress != 0 && window.active) animate = false;
44− dashContent.setCurrentScopeAtIndex(index, animate, isSwipe)
44+ dashContent.setCurrentScopeAtIndex(index, animate, true)
45 backToDashContent()
45 backToDashContent()
46 }
46 }
47 }
47 }
qml/Dash/DashContent.qml+1
@@ -84,6 +84,7 @@ Item {
84
84
85 if (reset) {
85 if (reset) {
86 dashContentList.currentItem.item.positionAtBeginning()
86 dashContentList.currentItem.item.positionAtBeginning()
87+ dashContentList.currentItem.item.resetSearch()
87 }
88 }
88 }
89 }
89
90
qml/Dash/GenericScopeView.qml+5
@@ -67,6 +67,11 @@ FocusScope {
67 subPageLoader.closeSubPage()
67 subPageLoader.closeSubPage()
68 }
68 }
69
69
70+ function resetSearch() {
71+ if(pageHeaderLoader.item && showPageHeader)
72+ pageHeaderLoader.item.resetSearch()
73+ }
74+
70 function itemClicked(index, result, item, itemModel, resultsModel, limitedCategoryItemCount, categoryId) {
75 function itemClicked(index, result, item, itemModel, resultsModel, limitedCategoryItemCount, categoryId) {
71 if (itemModel.uri.indexOf("scope://") === 0 || scope.id === "clickscope" || (scope.id === "videoaggregator" && categoryId === "myvideos-getstarted")) {
76 if (itemModel.uri.indexOf("scope://") === 0 || scope.id === "clickscope" || (scope.id === "videoaggregator" && categoryId === "myvideos-getstarted")) {
72 // TODO Technically it is possible that calling activate() will make the scope emit
77 // TODO Technically it is possible that calling activate() will make the scope emit
tests/qmltests/tst_Shell.qml+37
@@ -472,6 +472,41 @@ Rectangle {
472 confirmLoggedIn(data.loggedIn)
472 confirmLoggedIn(data.loggedIn)
473 }
473 }
474
474
475+ function test_longLeftEdgeSwipeTakesToAppsAndResetSearchString() {
476+ loadShell("phone");
477+ swipeAwayGreeter();
478+ dragLauncherIntoView();
479+ dashCommunicatorSpy.clear();
480+
481+ tapOnAppIconInLauncher();
482+ waitUntilApplicationWindowIsFullyVisible();
483+
484+ verify(ApplicationManager.focusedApplicationId !== "unity8-dash")
485+
486+ //Long left swipe
487+ swipeFromLeftEdge(units.gu(30));
488+
489+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
490+
491+ compare(dashCommunicatorSpy.count, 1);
492+ }
493+
494+ function test_ClickUbuntuIconInLauncherTakesToAppsAndResetSearchString() {
495+ loadShell("phone");
496+ swipeAwayGreeter();
497+ dragLauncherIntoView();
498+ dashCommunicatorSpy.clear();
499+
500+ var launcher = findChild(shell, "launcher");
501+ var dashIcon = findChild(launcher, "dashItem");
502+ verify(dashIcon != undefined);
503+ mouseClick(dashIcon);
504+
505+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
506+
507+ compare(dashCommunicatorSpy.count, 1);
508+ }
509+
475 function test_suspend() {
510 function test_suspend() {
476 loadShell("phone");
511 loadShell("phone");
477 swipeAwayGreeter();
512 swipeAwayGreeter();
@@ -1082,6 +1117,8 @@ Rectangle {
1082 }
1117 }
1083
1118
1084 function test_tapUbuntuIconInLauncherOverAppSpread() {
1119 function test_tapUbuntuIconInLauncherOverAppSpread() {
1120+ launcherShowDashHomeSpy.clear();
1121+
1085 loadShell("phone");
1122 loadShell("phone");
1086 swipeAwayGreeter();
1123 swipeAwayGreeter();
1087
1124