on xenial help sign in
invert logic for unfocusField to simplify argument handling
commit98793b825181c1c8e1b2368af8b7a0f093332150 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 3 Jul 2014, 11:16 (12 years ago) parent919598d
2 files changed+5−9
qml/Components/PageHeader.qml+4−8 qml/Dash/DashContent.qml+1−1
qml/Components/PageHeader.qml+4−8
@@ -42,15 +42,11 @@ Item {
4242 if (searchEntryEnabled) searchTextField.forceActiveFocus()
4343 }
4444
45− function resetSearch(unfocusField) {
46− if (unfocusField == undefined) {
47− unfocusField = true;
48− }
49−
45+ function resetSearch(keepFocus) {
5046 if (searchHistory) {
5147 searchHistory.addQuery(searchTextField.text);
5248 }
53− if (unfocusField) {
49+ if (!keepFocus) {
5450 unfocus();
5551 }
5652 searchTextField.text = "";
@@ -129,7 +125,7 @@ Item {
129125 backAction: Action {
130126 iconName: "back"
131127 onTriggered: {
132− root.resetSearch(true)
128+ root.resetSearch()
133129 headerContainer.showSearch = false
134130 }
135131 }
@@ -171,7 +167,7 @@ Item {
171167 }
172168
173169 onClicked: {
174− root.resetSearch(false)
170+ root.resetSearch(true)
175171 root.openSearchHistory()
176172 }
177173 }
qml/Dash/DashContent.qml+1−1
@@ -15,7 +15,7 @@
1515 */
1616
1717import QtQuick 2.0
18−import Ubuntu.Components 1.1
18+import Ubuntu.Components 0.1
1919import Unity 0.2
2020import Utils 0.1
2121import "../Components"