on xenial help sign in
Test the filterSettings button is there when textfield is unfocused
626c7e4Albert Astals Cid
qml/Dash/PageHeader.qml+4−4
@@ -200,6 +200,8 @@ Item {
200 rightMargin: units.gu(1)
200 rightMargin: units.gu(1)
201 }
201 }
202
202
203+ readonly property bool clearIsSettings: !searchTextField.focus && root.scopeHasFilters
204+
203 primaryItem: Label {
205 primaryItem: Label {
204 text: root.navigationTag
206 text: root.navigationTag
205 }
207 }
@@ -210,13 +212,11 @@ Item {
210 width: height
212 width: height
211 enabled: searchTextField.text.length > 0 || root.navigationTag != ""
213 enabled: searchTextField.text.length > 0 || root.navigationTag != ""
212
214
213− readonly property bool clearIsSettings: !searchTextField.focus && root.scopeHasFilters
214−
215 Image {
215 Image {
216 objectName: "clearIcon"
216 objectName: "clearIcon"
217 anchors.fill: parent
217 anchors.fill: parent
218 anchors.margins: units.gu(.75)
218 anchors.margins: units.gu(.75)
219− source: parent.clearIsSettings ? "image://theme/settings" : "image://theme/clear"
219+ source: searchTextField.clearIsSettings ? "image://theme/settings" : "image://theme/clear"
220 opacity: parent.enabled
220 opacity: parent.enabled
221 visible: opacity > 0
221 visible: opacity > 0
222 Behavior on opacity {
222 Behavior on opacity {
@@ -225,7 +225,7 @@ Item {
225 }
225 }
226
226
227 onClicked: {
227 onClicked: {
228− if (clearIsSettings) {
228+ if (searchTextField.clearIsSettings) {
229 root.showFiltersPopup(clearOrSettingsButton);
229 root.showFiltersPopup(clearOrSettingsButton);
230 } else {
230 } else {
231 root.clearSearch(true);
231 root.clearSearch(true);
tests/qmltests/Dash/tst_DashContent.qml+15
@@ -515,6 +515,21 @@ Item {
515 tryCompare(peExtraPanel, "visible", true);
515 tryCompare(peExtraPanel, "visible", true);
516 }
516 }
517
517
518+ function test_navigationShowFilterButton() {
519+ goToSecondLevel();
520+
521+ var dashContentList = findChild(dashContent, "dashContentList");
522+ var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
523+
524+ verify(!searchTextField.focus)
525+ verify(searchTextField.clearIsSettings)
526+
527+ mouseClick(searchTextField)
528+
529+ verify(searchTextField.focus)
530+ verify(!searchTextField.clearIsSettings)
531+ }
532+
518 function test_searchHint() {
533 function test_searchHint() {
519 var dashContentList = findChild(dashContent, "dashContentList");
534 var dashContentList = findChild(dashContent, "dashContentList");
520 verify(dashContentList !== null);
535 verify(dashContentList !== null);