on xenial help sign in
Test the filterSettings button is there when textfield is unfocused
commit626c7e43566347f947c12fb33c3fc277c315912b authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 13 Oct 2015, 13:15 (11 years ago) parentbceccaa
2 files changed+19−4
qml/Dash/PageHeader.qml+4−4 tests/qmltests/Dash/tst_DashContent.qml+15
qml/Dash/PageHeader.qml+4−4
@@ -200,6 +200,8 @@ Item {
200200 rightMargin: units.gu(1)
201201 }
202202
203+ readonly property bool clearIsSettings: !searchTextField.focus && root.scopeHasFilters
204+
203205 primaryItem: Label {
204206 text: root.navigationTag
205207 }
@@ -210,13 +212,11 @@ Item {
210212 width: height
211213 enabled: searchTextField.text.length > 0 || root.navigationTag != ""
212214
213− readonly property bool clearIsSettings: !searchTextField.focus && root.scopeHasFilters
214−
215215 Image {
216216 objectName: "clearIcon"
217217 anchors.fill: parent
218218 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"
220220 opacity: parent.enabled
221221 visible: opacity > 0
222222 Behavior on opacity {
@@ -225,7 +225,7 @@ Item {
225225 }
226226
227227 onClicked: {
228− if (clearIsSettings) {
228+ if (searchTextField.clearIsSettings) {
229229 root.showFiltersPopup(clearOrSettingsButton);
230230 } else {
231231 root.clearSearch(true);
tests/qmltests/Dash/tst_DashContent.qml+15
@@ -515,6 +515,21 @@ Item {
515515 tryCompare(peExtraPanel, "visible", true);
516516 }
517517
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+
518533 function test_searchHint() {
519534 var dashContentList = findChild(dashContent, "dashContentList");
520535 verify(dashContentList !== null);