@@ -17,7 +17,6 @@
1717import QtQuick 2.2
1818import Ubuntu.Components 1.1
1919import Ubuntu.Components.Themes.Ambiance 1.1
20−import Ubuntu.Components.Popups 1.0
2120import Ubuntu.Components.ListItems 1.0
2221import "../Components"
2322
@@ -27,6 +26,7 @@ Item {
2726 implicitHeight: headerContainer.height + bottomContainer.height + signatureLineHeight
2827 readonly property real signatureLineHeight: showSignatureLine ? units.gu(2) : 0
2928
29+ property bool scopeHasFilters: false
3030 property bool showBackButton: false
3131 property bool backIsClose: false
3232 property string title
@@ -55,6 +55,7 @@ Item {
5555 signal settingsClicked()
5656 signal favoriteClicked()
5757 signal searchTextFieldFocused()
58+ signal showFiltersPopup(var item)
5859
5960 onScopeStyleChanged: refreshLogo()
6061 onSearchQueryChanged: {
@@ -204,15 +205,18 @@ Item {
204205 }
205206
206207 secondaryItem: AbstractButton {
208+ id: clearOrSettingsButton
207209 height: searchTextField.height
208210 width: height
209211 enabled: searchTextField.text.length > 0 || root.navigationTag != ""
210212
213+ readonly property bool clearIsSettings: !searchTextField.focus && root.scopeHasFilters
214+
211215 Image {
212216 objectName: "clearIcon"
213217 anchors.fill: parent
214218 anchors.margins: units.gu(.75)
215− source: "image://theme/clear"
219+ source: parent.clearIsSettings ? "image://theme/settings" : "image://theme/clear"
216220 opacity: parent.enabled
217221 visible: opacity > 0
218222 Behavior on opacity {
@@ -221,7 +225,11 @@ Item {
221225 }
222226
223227 onClicked: {
224− root.clearSearch(true);
228+ if (clearIsSettings) {
229+ root.showFiltersPopup(clearOrSettingsButton);
230+ } else {
231+ root.clearSearch(true);
232+ }
225233 }
226234 }
227235