on xenial help sign in
Clicking on the (X) filters should open filters too instead of focus on search field
11d8a57Albert Astals Cid
qml/Dash/DashPageHeader.qml+35−26
@@ -219,41 +219,50 @@ Item {
219 }
219 }
220 }
220 }
221
221
222− secondaryItem: Row {
222+ secondaryItem: AbstractButton {
223+ id: clearOrSettingsButton
224+
223 height: searchTextField.height
225 height: searchTextField.height
226+ width: row.width
227+
228+ enabled: searchTextField.text.length > 0 || root.navigationTag != ""
224
229
225− AbstractButton {
230+ Row {
226− id: clearOrSettingsButton
231+ id: row
227 height: parent.height
232 height: parent.height
233+
234+ Item {
235+ height: parent.height
228− width: height
236+ width: height
229− enabled: searchTextField.text.length > 0 || root.navigationTag != ""
237+
230−
231− Image {
238+ Image {
232− objectName: "clearIcon"
233− anchors.fill: parent
239+ anchors.fill: parent
234− anchors.margins: units.gu(1)
240+ anchors.margins: units.gu(1)
241+
242+ objectName: "clearIcon"
235− source: searchTextField.clearIsSettings ? "image://theme/filters" : "image://theme/clear"
243+ source: searchTextField.clearIsSettings ? "image://theme/filters" : "image://theme/clear"
236− opacity: parent.enabled
244+ opacity: parent.enabled
237− visible: opacity > 0
245+ visible: opacity > 0
238− Behavior on opacity {
246+ Behavior on opacity {
239− UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
247+ UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
248+ }
240 }
249 }
241 }
250 }
242
251
243− onClicked: {
252+ Label {
244− if (searchTextField.clearIsSettings) {
253+ visible: searchTextField.clearIsSettings && root.activeFiltersCount > 0
245− root.showFiltersPopup(clearOrSettingsButton);
254+ height: parent.height
246− } else {
255+ text: "(" + root.activeFiltersCount + ")"
247− root.clearSearch(true);
256+ verticalAlignment: Text.AlignVCenter
248− }
249 }
257 }
250 }
258 }
251
259
252− Label {
260+ onClicked: {
253− visible: searchTextField.clearIsSettings && root.activeFiltersCount > 0
261+ if (searchTextField.clearIsSettings) {
254− height: parent.height
262+ root.showFiltersPopup(clearOrSettingsButton);
255− text: "(" + root.activeFiltersCount + ")"
263+ } else {
256− verticalAlignment: Text.AlignVCenter
264+ root.clearSearch(true);
265+ }
257 }
266 }
258 }
267 }
259
268