@@ -16,7 +16,7 @@
17import QtQuick 2.4
17import QtQuick 2.4
18import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
19−import Ubuntu.Components.Themes.Ambiance 1.3
19+import Ubuntu.Components.Popups 1.3
20import Ubuntu.Components.ListItems 1.3
20import Ubuntu.Components.ListItems 1.3
21import "../Components"
21import "../Components"
@@ -78,13 +78,13 @@ Item {
81− function closePopup(keepFocus) {
81+ function closePopup(keepFocus, keepSearch) {
82 if (extraPanel.visible) {
82 if (extraPanel.visible) {
83 extraPanel.visible = false;
83 extraPanel.visible = false;
84 } else if (!keepFocus) {
84 } else if (!keepFocus) {
85− unfocus();
85+ unfocus(keepSearch);
87− if (!searchTextField.text && !root.navigationTag && searchHistory.count == 0) {
87+ if (!keepSearch && !searchTextField.text && !root.navigationTag && searchHistory.count == 0) {
88 headerContainer.showSearch = false;
88 headerContainer.showSearch = false;
@@ -97,9 +97,9 @@ Item {
97 closePopup(keepFocus);
97 closePopup(keepFocus);
100− function unfocus() {
100+ function unfocus(keepSearch) {
101 searchTextField.focus = false;
101 searchTextField.focus = false;
102− if (!searchTextField.text && !root.navigationTag) {
102+ if (!keepSearch && !searchTextField.text && !root.navigationTag) {
103 headerContainer.showSearch = false;
103 headerContainer.showSearch = false;
@@ -142,7 +142,7 @@ Item {
142 objectName: "headerContainer"
142 objectName: "headerContainer"
143 clip: contentY < height
143 clip: contentY < height
144 anchors { left: parent.left; top: parent.top; right: parent.right }
144 anchors { left: parent.left; top: parent.top; right: parent.right }
145− height: header.contentHeight
145+ height: header.__styleInstance.contentHeight
146 contentHeight: headersColumn.height
146 contentHeight: headersColumn.height
147 interactive: false
147 interactive: false
148 contentY: showSearch ? 0 : height
148 contentY: showSearch ? 0 : height
@@ -173,22 +173,18 @@ Item {
173 id: headersColumn
173 id: headersColumn
174 anchors { left: parent.left; right: parent.right }
174 anchors { left: parent.left; right: parent.right }
176− PageHeadStyle {
176+ PageHeader {
177− // FIXME: Replace PageHeadStyle from the Ambiance theme by the new PageHeader from Ubuntu.Components 1.3.
178 id: searchHeader
177 id: searchHeader
179 anchors { left: parent.left; right: parent.right }
178 anchors { left: parent.left; right: parent.right }
180 opacity: headerContainer.clip || headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout
179 opacity: headerContainer.clip || headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout
181− __separator_visible: false
180+
182− // Required to keep PageHeadStyle noise down as it expects the Page's properties around.
181+ StyleHints {
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 {
189 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText
182 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText
183+ backgroundColor: "transparent"
184+ dividerColor: "transparent"
191− property var contents: Item {
187+ contents: Item {
192 anchors.fill: parent
188 anchors.fill: parent
194 TextField {
190 TextField {
@@ -273,7 +269,7 @@ Item {
273 anchors.fill: parent
269 anchors.fill: parent
274 anchors.margins: units.gu(2)
270 anchors.margins: units.gu(2)
275 name: "filters"
271 name: "filters"
276− color: root.activeFiltersCount > 0 ? UbuntuColors.orange : header.config.foregroundColor
272+ color: root.activeFiltersCount > 0 ? UbuntuColors.orange : header.__styleInstance.foregroundColor
279 onClicked: {
275 onClicked: {
@@ -283,6 +279,7 @@ Item {
284 AbstractButton {
280 AbstractButton {
285 id: cancelButton
281 id: cancelButton
282+ objectName: "cancelButton"
286 width: cancelLabel.width + cancelLabel.anchors.rightMargin + cancelLabel.anchors.leftMargin
283 width: cancelLabel.width + cancelLabel.anchors.rightMargin + cancelLabel.anchors.leftMargin
287 anchors {
284 anchors {
288 top: parent.top
285 top: parent.top
@@ -296,7 +293,7 @@ Item {
297 id: cancelLabel
294 id: cancelLabel
298 text: i18n.tr("Cancel")
295 text: i18n.tr("Cancel")
299− color: header.panelForegroundColor
296+ color: header.__styleInstance.foregroundColor
300 verticalAlignment: Text.AlignVCenter
297 verticalAlignment: Text.AlignVCenter
301 anchors {
298 anchors {
302 verticalCenter: parent.verticalCenter
299 verticalCenter: parent.verticalCenter
@@ -309,28 +306,27 @@ Item {
312− PageHeadStyle {
309+ PageHeader {
313− // FIXME: Replace PageHeadStyle from the Ambiance theme by the new PageHeader from Ubuntu.Components 1.3.
314 id: header
310 id: header
315 objectName: "innerPageHeader"
311 objectName: "innerPageHeader"
316 anchors { left: parent.left; right: parent.right }
312 anchors { left: parent.left; right: parent.right }
317 height: headerContainer.height
313 height: headerContainer.height
318 opacity: headerContainer.clip || !headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout
314 opacity: headerContainer.clip || !headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout
319− __separator_visible: false
315+ title: root.title
320− property var styledItem: header
316+
321− property color dividerColor: "transparent" // Doesn't matter as we don't have PageHeadSections
317+ StyleHints {
322− property color panelColor: background.topColor
323− panelForegroundColor: config.foregroundColor
324− backgroundColor: "transparent"
325− config: PageHeadConfiguration {
327 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText
318 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText
328− backAction: Action {
319+ backgroundColor: "transparent"
320+ dividerColor: "transparent"
323+ leadingActionBar.actions: Action {
329− iconName: backIsClose ? "close" : "back"
324+ iconName: backIsClose ? "close" : "back"
330− visible: root.showBackButton
325+ visible: root.showBackButton
331− onTriggered: root.backClicked()
326+ onTriggered: root.backClicked()
334 actions: [
330 actions: [
336 objectName: "store"
332 objectName: "store"
@@ -366,7 +362,6 @@ Item {
369− property var contents: null
370 Component.onCompleted: root.refreshLogo()
365 Component.onCompleted: root.refreshLogo()
372 Component {
367 Component {