on xenial help sign in
Clicking on the (X) filters should open filters too instead of focus on search field
commit11d8a574fac8dd6e5a2a02a1d69a824d85eaa142 authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 26 Jan 2016, 11:48 (11 years ago) parent32f9adf
1 file changed+35−26
qml/Dash/DashPageHeader.qml+35−26
qml/Dash/DashPageHeader.qml+35−26
@@ -219,41 +219,50 @@ Item {
219219 }
220220 }
221221
222− secondaryItem: Row {
222+ secondaryItem: AbstractButton {
223+ id: clearOrSettingsButton
224+
223225 height: searchTextField.height
226+ width: row.width
227+
228+ enabled: searchTextField.text.length > 0 || root.navigationTag != ""
224229
225− AbstractButton {
226− id: clearOrSettingsButton
230+ Row {
231+ id: row
227232 height: parent.height
228− width: height
229− enabled: searchTextField.text.length > 0 || root.navigationTag != ""
230−
231− Image {
232− objectName: "clearIcon"
233− anchors.fill: parent
234− anchors.margins: units.gu(1)
235− source: searchTextField.clearIsSettings ? "image://theme/filters" : "image://theme/clear"
236− opacity: parent.enabled
237− visible: opacity > 0
238− Behavior on opacity {
239− UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
233+
234+ Item {
235+ height: parent.height
236+ width: height
237+
238+ Image {
239+ anchors.fill: parent
240+ anchors.margins: units.gu(1)
241+
242+ objectName: "clearIcon"
243+ source: searchTextField.clearIsSettings ? "image://theme/filters" : "image://theme/clear"
244+ opacity: parent.enabled
245+ visible: opacity > 0
246+ Behavior on opacity {
247+ UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
248+ }
240249 }
241250 }
242251
243− onClicked: {
244− if (searchTextField.clearIsSettings) {
245− root.showFiltersPopup(clearOrSettingsButton);
246− } else {
247− root.clearSearch(true);
248− }
252+ Label {
253+ visible: searchTextField.clearIsSettings && root.activeFiltersCount > 0
254+ height: parent.height
255+ text: "(" + root.activeFiltersCount + ")"
256+ verticalAlignment: Text.AlignVCenter
249257 }
250258 }
251259
252− Label {
253− visible: searchTextField.clearIsSettings && root.activeFiltersCount > 0
254− height: parent.height
255− text: "(" + root.activeFiltersCount + ")"
256− verticalAlignment: Text.AlignVCenter
260+ onClicked: {
261+ if (searchTextField.clearIsSettings) {
262+ root.showFiltersPopup(clearOrSettingsButton);
263+ } else {
264+ root.clearSearch(true);
265+ }
257266 }
258267 }
259268