on xenial help sign in
Close popup on click if it's shown
commit7ce2be3b162c9faf0b70d5a4b171edf3b33a51f2 authorAlbert Astals <albert.astals@canonical.com> dateFri 18 Jul 2014, 11:55 (12 years ago) parentaf5e518
2 files changed+9−7
qml/Components/PageHeader.qml+8−6 qml/Dash/ScopesOverview.qml+1−1
qml/Components/PageHeader.qml+8−6
@@ -61,9 +61,7 @@ Item {
6161 unfocus();
6262 }
6363 searchTextField.text = "";
64− if (headerContainer.popover != null) {
65− PopupUtils.close(headerContainer.popover);
66− }
64+ closeSearchHistory();
6765 }
6866
6967 function unfocus() {
@@ -86,6 +84,12 @@ Item {
8684 }
8785 }
8886
87+ function closeSearchHistory() {
88+ if (headerContainer.popover != null) {
89+ PopupUtils.close(headerContainer.popover);
90+ }
91+ }
92+
8993 function refreshLogo() {
9094 if (scopeStyle ? scopeStyle.headerLogo != "" : false) {
9195 header.contents = imageComponent.createObject();
@@ -104,9 +108,7 @@ Item {
104108 anchors { fill: parent; margins: units.gu(1); bottomMargin: units.gu(3) + bottomContainer.height }
105109 visible: headerContainer.showSearch
106110 onPressed: {
107− if (headerContainer.popover) {
108− PopupUtils.close(headerContainer.popover);
109− }
111+ closeSearchHistory();
110112 if (!searchTextField.text) {
111113 headerContainer.showSearch = false;
112114 }
qml/Dash/ScopesOverview.qml+1−1
@@ -307,7 +307,7 @@ Item {
307307 Behavior on opacity { UbuntuNumberAnimation { } }
308308
309309 clickOverride: function (index, result, item, itemModel) {
310− // TODO Make sure pageheader suggestions popup is hidden
310+ pageHeader.closeSearchHistory();
311311 if (itemModel.scopeId) {
312312 root.searchSelected(itemModel.scopeId, item.mapToItem(null, 0, 0), Qt.size(item.width, item.height));
313313 } else {