on xenial help sign in
keepPanel open means keep, not reopen if it wasn't open
149f243Albert Astals Cid
qml/Dash/GenericScopeView.qml+3−2
@@ -635,11 +635,12 @@ FocusScope {
635 onSettingsClicked: subPageLoader.openSubPage("settings")
635 onSettingsClicked: subPageLoader.openSubPage("settings")
636 onFavoriteClicked: scopeView.scope.favorite = !scopeView.scope.favorite
636 onFavoriteClicked: scopeView.scope.favorite = !scopeView.scope.favorite
637 onSearchTextFieldFocused: scopeView.showHeader()
637 onSearchTextFieldFocused: scopeView.showHeader()
638− onClearSearch: {
638+ onClearSearch: { // keepPanelOpen
639+ var panelOpen = peExtraPanel.visible;
639 resetSearch(keepPanelOpen);
640 resetSearch(keepPanelOpen);
640 scopeView.scope.resetPrimaryNavigationTag();
641 scopeView.scope.resetPrimaryNavigationTag();
641 peExtraPanel.resetNavigation();
642 peExtraPanel.resetNavigation();
642− if (keepPanelOpen) {
643+ if (panelOpen && keepPanelOpen) {
643 openPopup();
644 openPopup();
644 }
645 }
645 }
646 }
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);