on xenial help sign in
Merge
commitbe3b688f1fb3b8ce6409e1b875254ec3f526568c authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 26 Jan 2016, 11:53 (11 years ago) parent40dee3d11d8a57
2 files changed+36−27
qml/Dash/DashPageHeader.qml+35−26 qml/Dash/PageHeaderExtraPanel.qml+1−1
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
qml/Dash/PageHeaderExtraPanel.qml+1−1
@@ -123,7 +123,7 @@ Item {
123123
124124 divider.visible: index != repeater.count - 1 || (scope && scope.hasNavigation) || primaryFilter.active
125125
126− onClicked: root.historyItemClicked(text)
126+ onClicked: root.historyItemClicked(query)
127127 }
128128 }
129129 }