on xenial help sign in
Merge
39f1a2cAlbert Astals Cid
qml/Dash/GenericScopeView.qml+3−2
@@ -637,11 +637,12 @@ FocusScope {
637 onSettingsClicked: subPageLoader.openSubPage("settings")
637 onSettingsClicked: subPageLoader.openSubPage("settings")
638 onFavoriteClicked: scopeView.scope.favorite = !scopeView.scope.favorite
638 onFavoriteClicked: scopeView.scope.favorite = !scopeView.scope.favorite
639 onSearchTextFieldFocused: scopeView.showHeader()
639 onSearchTextFieldFocused: scopeView.showHeader()
640− onClearSearch: {
640+ onClearSearch: { // keepPanelOpen
641+ var panelOpen = peExtraPanel.visible;
641 resetSearch(keepPanelOpen);
642 resetSearch(keepPanelOpen);
642 scopeView.scope.resetPrimaryNavigationTag();
643 scopeView.scope.resetPrimaryNavigationTag();
643 peExtraPanel.resetNavigation();
644 peExtraPanel.resetNavigation();
644− if (keepPanelOpen) {
645+ if (panelOpen && keepPanelOpen) {
645 openPopup();
646 openPopup();
646 }
647 }
647 }
648 }
tests/qmltests/Dash/tst_DashContent.qml+20
@@ -495,6 +495,26 @@ Item {
495 compare(peExtraPanel.visible, true);
495 compare(peExtraPanel.visible, true);
496 }
496 }
497
497
498+ function test_clearSearchWithNavigationClosed() {
499+ var dashContentList = findChild(dashContent, "dashContentList");
500+ var searchButton = findChild(dashContentList.currentItem, "search_header_button");
501+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
502+ var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
503+
504+ compare(peExtraPanel.visible, false);
505+ mouseClick(searchButton);
506+ tryCompare(peExtraPanel, "visible", true);
507+
508+ typeString("A");
509+ compare(peExtraPanel.visible, false);
510+
511+ var clearIcon = findChild(searchTextField, "clearIcon");
512+ mouseClick(clearIcon);
513+
514+ expectFail("", "Extra panel should not be visible after clearing search if it was not visible before");
515+ tryCompare(peExtraPanel, "visible", true);
516+ }
517+
498 function test_searchHint() {
518 function test_searchHint() {
499 var dashContentList = findChild(dashContent, "dashContentList");
519 var dashContentList = findChild(dashContent, "dashContentList");
500 verify(dashContentList !== null);
520 verify(dashContentList !== null);