@@ -202,51 +202,43 @@ Item {
202 left: parent.left
202 left: parent.left
203 bottom: parent.bottom
203 bottom: parent.bottom
204 bottomMargin: units.gu(1)
204 bottomMargin: units.gu(1)
205− right: cancelLabel.left
205+ right: settingsButton.left
206− rightMargin: units.gu(1)
206+ rightMargin: settingsButton.visible ? 0 : units.gu(2)
209− readonly property bool clearIsSettings: !searchTextField.focus && root.scopeHasFilters
211− primaryItem: Label {
209+ primaryItem: Rectangle {
211+ width: root.navigationTag != "" ? tagLabel.width + units.gu(2) : 0
212+ height: root.navigationTag != "" ? tagLabel.height + units.gu(1) : 0
213+ radius: units.gu(0.5)
212− text: root.navigationTag
216+ text: root.navigationTag
217+ anchors.centerIn: parent
215− secondaryItem: Row {
222+ secondaryItem: AbstractButton {
216 height: searchTextField.height
224 height: searchTextField.height
219− id: clearOrSettingsButton
220− height: parent.height
221− width: height
225+ width: height
222− enabled: searchTextField.text.length > 0 || root.navigationTag != ""
226+ enabled: searchTextField.text.length > 0 || root.navigationTag != ""
225− objectName: "clearIcon"
229+ objectName: "clearIcon"
226− anchors.fill: parent
230+ anchors.fill: parent
227− anchors.margins: units.gu(.75)
231+ anchors.margins: units.gu(1)
228− source: searchTextField.clearIsSettings ? "image://theme/settings" : "image://theme/clear"
232+ source: "image://theme/clear"
229− opacity: parent.enabled
233+ opacity: parent.enabled
230− visible: opacity > 0
234+ visible: opacity > 0
231− Behavior on opacity {
235+ Behavior on opacity {
232− UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
236+ UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
237− if (searchTextField.clearIsSettings) {
238− root.showFiltersPopup(clearOrSettingsButton);
240− root.clearSearch(true);
245− Label {
240+ onClicked: {
246− visible: searchTextField.clearIsSettings && root.activeFiltersCount > 0
241+ root.clearSearch(true);
247− height: parent.height
248− text: root.activeFiltersCount
249− verticalAlignment: Text.AlignVCenter
@@ -264,22 +256,52 @@ Item {
267− Label {
259+ AbstractButton {
268− id: cancelLabel
260+ id: settingsButton
269− text: i18n.tr("Cancel")
261+
270− color: header.panelForegroundColor
262+ width: root.scopeHasFilters ? height : 0
271− verticalAlignment: Text.AlignVCenter
263+ visible: width > 0
272 anchors {
264 anchors {
273 top: parent.top
265 top: parent.top
274− right: parent.right
266+ right: cancelButton.left
275 bottom: parent.bottom
267 bottom: parent.bottom
276− margins: units.gu(1)
268+ rightMargin: units.gu(-1)
278− AbstractButton {
270+
279 anchors.fill: parent
272 anchors.fill: parent
273+ anchors.margins: units.gu(2)
275+ color: root.activeFiltersCount > 0 ? UbuntuColors.orange : Qt.rgba(0.0, 0.0, 0.0, 0.0)
279+ root.showFiltersPopup(settingsButton);
285+ width: cancelLabel.width + cancelLabel.anchors.rightMargin + cancelLabel.anchors.leftMargin
289+ bottom: parent.bottom
280− onClicked: {
291+ onClicked: {
281− root.clearSearch(false);
292+ root.clearSearch(false);
282− headerContainer.showSearch = false;
293+ headerContainer.showSearch = false;
297+ text: i18n.tr("Cancel")
298+ color: header.panelForegroundColor
299+ verticalAlignment: Text.AlignVCenter
301+ verticalCenter: parent.verticalCenter
303+ rightMargin: units.gu(2)
304+ leftMargin: units.gu(1)