@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.4
1818import Ubuntu.Components 1.3
19−import Ubuntu.Components.Themes.Ambiance 1.3
19+import Ubuntu.Components.Popups 1.3
2020import Ubuntu.Components.ListItems 1.3
2121import "../Components"
2222
@@ -78,13 +78,13 @@ Item {
7878 }
7979 }
8080
81− function closePopup(keepFocus) {
81+ function closePopup(keepFocus, keepSearch) {
8282 if (extraPanel.visible) {
8383 extraPanel.visible = false;
8484 } else if (!keepFocus) {
85− unfocus();
85+ unfocus(keepSearch);
8686 }
87− if (!searchTextField.text && !root.navigationTag && searchHistory.count == 0) {
87+ if (!keepSearch && !searchTextField.text && !root.navigationTag && searchHistory.count == 0) {
8888 headerContainer.showSearch = false;
8989 }
9090 }
@@ -97,9 +97,9 @@ Item {
9797 closePopup(keepFocus);
9898 }
9999
100− function unfocus() {
100+ function unfocus(keepSearch) {
101101 searchTextField.focus = false;
102− if (!searchTextField.text && !root.navigationTag) {
102+ if (!keepSearch && !searchTextField.text && !root.navigationTag) {
103103 headerContainer.showSearch = false;
104104 }
105105 }
@@ -142,7 +142,7 @@ Item {
142142 objectName: "headerContainer"
143143 clip: contentY < height
144144 anchors { left: parent.left; top: parent.top; right: parent.right }
145− height: header.contentHeight
145+ height: header.__styleInstance.contentHeight
146146 contentHeight: headersColumn.height
147147 interactive: false
148148 contentY: showSearch ? 0 : height
@@ -173,22 +173,18 @@ Item {
173173 id: headersColumn
174174 anchors { left: parent.left; right: parent.right }
175175
176− PageHeadStyle {
177− // FIXME: Replace PageHeadStyle from the Ambiance theme by the new PageHeader from Ubuntu.Components 1.3.
176+ PageHeader {
178177 id: searchHeader
179178 anchors { left: parent.left; right: parent.right }
180179 opacity: headerContainer.clip || headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout
181− __separator_visible: false
182− // Required to keep PageHeadStyle noise down as it expects the Page's properties around.
183− property var styledItem: searchHeader
184− property color dividerColor: "transparent" // Doesn't matter as we don't have PageHeadSections
185− property color panelColor: background.topColor
186− panelForegroundColor: config.foregroundColor
187− backgroundColor: "transparent"
188− config: PageHeadConfiguration {
180+
181+ StyleHints {
189182 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText
183+ backgroundColor: "transparent"
184+ dividerColor: "transparent"
190185 }
191− property var contents: Item {
186+
187+ contents: Item {
192188 anchors.fill: parent
193189
194190 TextField {
@@ -273,7 +269,7 @@ Item {
273269 anchors.fill: parent
274270 anchors.margins: units.gu(2)
275271 name: "filters"
276− color: root.activeFiltersCount > 0 ? UbuntuColors.orange : header.config.foregroundColor
272+ color: root.activeFiltersCount > 0 ? UbuntuColors.orange : header.__styleInstance.foregroundColor
277273 }
278274
279275 onClicked: {
@@ -283,6 +279,7 @@ Item {
283279
284280 AbstractButton {
285281 id: cancelButton
282+ objectName: "cancelButton"
286283 width: cancelLabel.width + cancelLabel.anchors.rightMargin + cancelLabel.anchors.leftMargin
287284 anchors {
288285 top: parent.top
@@ -296,7 +293,7 @@ Item {
296293 Label {
297294 id: cancelLabel
298295 text: i18n.tr("Cancel")
299− color: header.panelForegroundColor
296+ color: header.__styleInstance.foregroundColor
300297 verticalAlignment: Text.AlignVCenter
301298 anchors {
302299 verticalCenter: parent.verticalCenter
@@ -309,28 +306,27 @@ Item {
309306 }
310307 }
311308
312− PageHeadStyle {
313− // FIXME: Replace PageHeadStyle from the Ambiance theme by the new PageHeader from Ubuntu.Components 1.3.
309+ PageHeader {
314310 id: header
315311 objectName: "innerPageHeader"
316312 anchors { left: parent.left; right: parent.right }
317313 height: headerContainer.height
318314 opacity: headerContainer.clip || !headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout
319− __separator_visible: false
320− property var styledItem: header
321− property color dividerColor: "transparent" // Doesn't matter as we don't have PageHeadSections
322− property color panelColor: background.topColor
323− panelForegroundColor: config.foregroundColor
324− backgroundColor: "transparent"
325− config: PageHeadConfiguration {
326− title: root.title
315+ title: root.title
316+
317+ StyleHints {
327318 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText
328− backAction: Action {
329− iconName: backIsClose ? "close" : "back"
330− visible: root.showBackButton
331− onTriggered: root.backClicked()
332− }
319+ backgroundColor: "transparent"
320+ dividerColor: "transparent"
321+ }
322+
323+ leadingActionBar.actions: Action {
324+ iconName: backIsClose ? "close" : "back"
325+ visible: root.showBackButton
326+ onTriggered: root.backClicked()
327+ }
333328
329+ trailingActionBar {
334330 actions: [
335331 Action {
336332 objectName: "store"
@@ -366,7 +362,6 @@ Item {
366362 ]
367363 }
368364
369− property var contents: null
370365 Component.onCompleted: root.refreshLogo()
371366
372367 Component {