on xenial help sign in
Close popup on click if it's shown
7ce2be3Albert Astals
qml/Components/PageHeader.qml+8−6
@@ -61,9 +61,7 @@ Item {
61 unfocus();
61 unfocus();
62 }
62 }
63 searchTextField.text = "";
63 searchTextField.text = "";
64− if (headerContainer.popover != null) {
64+ closeSearchHistory();
65− PopupUtils.close(headerContainer.popover);
66− }
67 }
65 }
68
66
69 function unfocus() {
67 function unfocus() {
@@ -86,6 +84,12 @@ Item {
86 }
84 }
87 }
85 }
88
86
87+ function closeSearchHistory() {
88+ if (headerContainer.popover != null) {
89+ PopupUtils.close(headerContainer.popover);
90+ }
91+ }
92+
89 function refreshLogo() {
93 function refreshLogo() {
90 if (scopeStyle ? scopeStyle.headerLogo != "" : false) {
94 if (scopeStyle ? scopeStyle.headerLogo != "" : false) {
91 header.contents = imageComponent.createObject();
95 header.contents = imageComponent.createObject();
@@ -104,9 +108,7 @@ Item {
104 anchors { fill: parent; margins: units.gu(1); bottomMargin: units.gu(3) + bottomContainer.height }
108 anchors { fill: parent; margins: units.gu(1); bottomMargin: units.gu(3) + bottomContainer.height }
105 visible: headerContainer.showSearch
109 visible: headerContainer.showSearch
106 onPressed: {
110 onPressed: {
107− if (headerContainer.popover) {
111+ closeSearchHistory();
108− PopupUtils.close(headerContainer.popover);
109− }
110 if (!searchTextField.text) {
112 if (!searchTextField.text) {
111 headerContainer.showSearch = false;
113 headerContainer.showSearch = false;
112 }
114 }
qml/Dash/ScopesOverview.qml+1−1
@@ -307,7 +307,7 @@ Item {
307 Behavior on opacity { UbuntuNumberAnimation { } }
307 Behavior on opacity { UbuntuNumberAnimation { } }
308
308
309 clickOverride: function (index, result, item, itemModel) {
309 clickOverride: function (index, result, item, itemModel) {
310− // TODO Make sure pageheader suggestions popup is hidden
310+ pageHeader.closeSearchHistory();
311 if (itemModel.scopeId) {
311 if (itemModel.scopeId) {
312 root.searchSelected(itemModel.scopeId, item.mapToItem(null, 0, 0), Qt.size(item.width, item.height));
312 root.searchSelected(itemModel.scopeId, item.mapToItem(null, 0, 0), Qt.size(item.width, item.height));
313 } else {
313 } else {