on xenial help sign in
makes left swip reset the search string. Fixes: #1413791

Approved by: Albert Astals Cid

commitf92e7acaed9fa17bdad04c918f00838901e261e2 authorhandsome_feng <445865575@qq.com> dateWed 29 Jul 2015, 12:38 (11 years ago) parent3b6977933f6631
4 files changed+44−1
qml/Dash/Dash.qml+1−1 qml/Dash/DashContent.qml+1 qml/Dash/GenericScopeView.qml+5 tests/qmltests/tst_Shell.qml+37
qml/Dash/Dash.qml+1−1
@@ -41,7 +41,7 @@ Showable {
4141 onSetCurrentScopeRequested: {
4242 if (!isSwipe || !window.active || bottomEdgeController.progress != 0 || scopeItem.scope || dashContent.subPageShown) {
4343 if (bottomEdgeController.progress != 0 && window.active) animate = false;
44− dashContent.setCurrentScopeAtIndex(index, animate, isSwipe)
44+ dashContent.setCurrentScopeAtIndex(index, animate, true)
4545 backToDashContent()
4646 }
4747 }
qml/Dash/DashContent.qml+1
@@ -84,6 +84,7 @@ Item {
8484
8585 if (reset) {
8686 dashContentList.currentItem.item.positionAtBeginning()
87+ dashContentList.currentItem.item.resetSearch()
8788 }
8889 }
8990
qml/Dash/GenericScopeView.qml+5
@@ -67,6 +67,11 @@ FocusScope {
6767 subPageLoader.closeSubPage()
6868 }
6969
70+ function resetSearch() {
71+ if(pageHeaderLoader.item && showPageHeader)
72+ pageHeaderLoader.item.resetSearch()
73+ }
74+
7075 function itemClicked(index, result, item, itemModel, resultsModel, limitedCategoryItemCount, categoryId) {
7176 if (itemModel.uri.indexOf("scope://") === 0 || scope.id === "clickscope" || (scope.id === "videoaggregator" && categoryId === "myvideos-getstarted")) {
7277 // TODO Technically it is possible that calling activate() will make the scope emit
tests/qmltests/tst_Shell.qml+37
@@ -472,6 +472,41 @@ Rectangle {
472472 confirmLoggedIn(data.loggedIn)
473473 }
474474
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+
475510 function test_suspend() {
476511 loadShell("phone");
477512 swipeAwayGreeter();
@@ -1082,6 +1117,8 @@ Rectangle {
10821117 }
10831118
10841119 function test_tapUbuntuIconInLauncherOverAppSpread() {
1120+ launcherShowDashHomeSpy.clear();
1121+
10851122 loadShell("phone");
10861123 swipeAwayGreeter();
10871124