on xenial help sign in
Workaround the SDK change in our side
commit81b336bd91c8ed4622ccce6669a5ddd68fef34cc authorAlbert Astals <albert.astals@canonical.com> dateThu 28 Aug 2014, 12:06 (12 years ago) parentf749fca
1 file changed+13−11
qml/Dash/PageHeader.qml+13−11
qml/Dash/PageHeader.qml+13−11
@@ -64,9 +64,12 @@ Item {
6464 }
6565 }
6666
67− function closePopup() {
67+ function closePopup(keepFocus) {
6868 if (headerContainer.popover != null) {
69+ headerContainer.popover.unfocus = !keepFocus;
6970 PopupUtils.close(headerContainer.popover);
71+ } else if (!keepFocus) {
72+ unfocus();
7073 }
7174 }
7275
@@ -74,11 +77,8 @@ Item {
7477 if (searchHistory) {
7578 searchHistory.addQuery(searchTextField.text);
7679 }
77− if (!keepFocus) {
78− unfocus();
79− }
8080 searchTextField.text = "";
81− closePopup();
81+ closePopup(keepFocus);
8282 }
8383
8484 function unfocus() {
@@ -119,11 +119,10 @@ Item {
119119 anchors { fill: parent; margins: units.gu(1); bottomMargin: units.gu(3) + bottomContainer.height }
120120 visible: headerContainer.showSearch
121121 onPressed: {
122− closePopup();
122+ closePopup(/* keepFocus */false);
123123 if (!searchTextField.text) {
124124 headerContainer.showSearch = false;
125125 }
126− searchTextField.focus = false;
127126 mouse.accepted = false;
128127 }
129128 }
@@ -228,7 +227,7 @@ Item {
228227
229228 onTextChanged: {
230229 if (text != "") {
231− closePopup();
230+ closePopup(/* keepFocus */true);
232231 }
233232 }
234233 }
@@ -309,10 +308,14 @@ Item {
309308 Popover {
310309 id: popover
311310 autoClose: false
312− restoreFocusOnClose: false
311+
312+ property bool unfocus: false
313313
314314 Component.onDestruction: {
315315 headerContainer.popover = null;
316+ if (unfocus) {
317+ root.unfocus();
318+ }
316319 }
317320
318321 Column {
@@ -333,8 +336,7 @@ Item {
333336 onClicked: {
334337 searchHistory.addQuery(text);
335338 searchTextField.text = text;
336− closePopup();
337− unfocus();
339+ closePopup(/* keepFocus */false);
338340 }
339341 }
340342 }