Merge lp:~mterry/unity8/less-ubuntucolors into lp:unity8

Proposed by Michael Terry
Status: Superseded
Proposed branch: lp:~mterry/unity8/less-ubuntucolors
Merge into: lp:unity8
Prerequisite: lp:~cimi/unity8/uitkPageHeader
Diff against target: 710 lines (+137/-142)
23 files modified
plugins/Dash/AudioProgressBar.qml (+1/-1)
plugins/Dash/ScopeStyle.qml (+1/-1)
qml/Components/Dialogs.qml (+2/-2)
qml/Components/Header.qml (+0/-28)
qml/Components/ModeSwitchWarningDialog.qml (+1/-1)
qml/Components/WindowControlButtons.qml (+1/-1)
qml/Dash/DashPageHeader.qml (+32/-37)
qml/Dash/GenericScopeView.qml (+5/-0)
qml/Dash/Previews/PreviewActions.qml (+1/-1)
qml/Dash/Previews/PreviewPayments.qml (+1/-1)
qml/Launcher/LauncherDelegate.qml (+2/-2)
qml/Panel/Panel.qml (+1/-1)
qml/Stages/DecoratedWindow.qml (+1/-1)
qml/Stages/DesktopSpread.qml (+1/-1)
qml/Stages/DesktopSpreadDelegate.qml (+1/-1)
qml/Stages/Splash.qml (+7/-19)
qml/Stages/SpreadDelegate.qml (+1/-1)
tests/plugins/Dash/tst_ScopeStyle.qml (+1/-1)
tests/qmltests/Dash/tst_Dash.qml (+8/-8)
tests/qmltests/Dash/tst_DashContent.qml (+64/-5)
tests/qmltests/Dash/tst_DashPageHeader.qml (+0/-24)
tests/qmltests/Dash/tst_GenericScopeView.qml (+2/-2)
tests/qmltests/Dash/tst_PreviewView.qml (+3/-3)
To merge this branch: bzr merge lp:~mterry/unity8/less-ubuntucolors
Reviewer Review Type Date Requested Status
Andrea Cimitan (community) Approve
Unity8 CI Bot continuous-integration Approve
Review via email: mp+294812@code.launchpad.net

This proposal supersedes a proposal from 2016-05-12.

This proposal has been superseded by a proposal from 2016-05-17.

Commit message

Change some dash button colors from orange to green.

And switch other colors from hardcoded values to the same semantic theme value.

Description of the change

UbuntuColors should be avoided when possible. Instead we should use semantic color names from the theme. These are future-proof and potentially locale-proof (for locales where green and red mean different things -- which I heard was a thing, but can't find anything on it in a quick search).

Half this branch simply replaces some color names with the correct theme color. So no visual change there. But it also changes some colors:

plugins/Dash/AudioProgressBar.qml: progress bar color from orange to "activity" (blue)
plugins/Dash/ScopeStyle.qml: preview button color from orange to "positive" (green)
qml/Dash/DashPageHeader.qml: active filter color from orange to "positive" (green)
qml/Dash/Previews/PreviewActions.qml: button color from orange to "positive" (green)
qml/Dash/Previews/PreviewPayments.qml: purchase button color from orange to "positive" (green)

I didn't change any uses of the various "grey" colors (slate, jet, charcoal, etc). That seemed a bit more fiddly and less user visible. But they should in theory be fixed down the road.

 * Are there any related MPs required for this MP to build/function as expected? Please list.
 Just the pre-req (lp:~cimi/unity8/uitkPageHeader)

 * Did you perform an exploratory manual test run of your code change and any related functionality?
 Not yet.. will do in a bit

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 NA

 * If you changed the UI, has there been a design review?
 No... Do we need one for just using the correct theme colors? The only border case I'd see is the purchase button -- maybe that's supposed to be branding-colored?

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2396
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1203/
Executed test runs:
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/740
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/740
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1612
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1567
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1567
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1560
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1560/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1560
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1560/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1560
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1560/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1560
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1560/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1560
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1560/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1560
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1560/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1203/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote : Posted in a previous version of this proposal

Please rebase on https://code.launchpad.net/~cimi/unity8/uitkPageHeader/+merge/293608 since it will conflict in DashPageHeader.qml

review: Needs Fixing
Revision history for this message
Michael Terry (mterry) wrote :

Done, rebased on uitkPageHeader. Thanks for the pointer.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2397
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1223/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/760
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/760
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1640
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1593
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1593
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1586
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1586/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1586
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1586/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1586
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1586/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1586
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1586/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1586
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1586/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1586
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1586/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1223/rebuild

review: Approve (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
y
 * Did CI run pass? If not, please explain why.
y

thank you, we'll see for the purchase button

review: Approve
lp:~mterry/unity8/less-ubuntucolors updated
2331. By Michael Terry

Use PageHeader instead Ambiance's PageHeadStyle

2332. By Michael Terry

Fix some uses of UbuntuColors

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Dash/AudioProgressBar.qml'
2--- plugins/Dash/AudioProgressBar.qml 2016-01-18 22:56:16 +0000
3+++ plugins/Dash/AudioProgressBar.qml 2016-05-17 20:47:20 +0000
4@@ -49,6 +49,6 @@
5 rightMargin: maxWidth - (maxWidth * root.progress)
6 }
7 height: units.dp(2)
8- backgroundColor: UbuntuColors.orange
9+ backgroundColor: theme.palette.normal.activity
10 }
11 }
12
13=== modified file 'plugins/Dash/ScopeStyle.qml'
14--- plugins/Dash/ScopeStyle.qml 2016-03-29 03:47:39 +0000
15+++ plugins/Dash/ScopeStyle.qml 2016-05-17 20:47:20 +0000
16@@ -70,7 +70,7 @@
17 readonly property url navigationBackground: "navigation-background" in d.headerStyle ? d.headerStyle["navigation-background"] : "color:///#f5f5f5"
18
19 /// Color of the primary preview button
20- readonly property color previewButtonColor: "preview-button-color" in style ? style["preview-button-color"] : UbuntuColors.orange
21+ readonly property color previewButtonColor: "preview-button-color" in style ? style["preview-button-color"] : theme.palette.normal.positive
22
23 //! @cond
24 property var d: QtObject {
25
26=== modified file 'qml/Components/Dialogs.qml'
27--- qml/Components/Dialogs.qml 2016-04-27 15:01:10 +0000
28+++ qml/Components/Dialogs.qml 2016-05-17 20:47:20 +0000
29@@ -185,7 +185,7 @@
30 unitySessionService.reboot();
31 rebootDialog.hide();
32 }
33- color: UbuntuColors.red
34+ color: theme.palette.normal.negative
35 }
36 }
37 }
38@@ -203,7 +203,7 @@
39 powerDialog.hide();
40 root.powerOffClicked();
41 }
42- color: UbuntuColors.red
43+ color: theme.palette.normal.negative
44 }
45 Button {
46 text: i18n.ctr("Button: Restart the system", "Restart")
47
48=== removed file 'qml/Components/Header.qml'
49--- qml/Components/Header.qml 2016-01-25 10:12:48 +0000
50+++ qml/Components/Header.qml 1970-01-01 00:00:00 +0000
51@@ -1,28 +0,0 @@
52-/*
53- * Copyright (C) 2014 Canonical, Ltd.
54- *
55- * This program is free software; you can redistribute it and/or modify
56- * it under the terms of the GNU General Public License as published by
57- * the Free Software Foundation; version 3.
58- *
59- * This program is distributed in the hope that it will be useful,
60- * but WITHOUT ANY WARRANTY; without even the implied warranty of
61- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62- * GNU General Public License for more details.
63- *
64- * You should have received a copy of the GNU General Public License
65- * along with this program. If not, see <http://www.gnu.org/licenses/>.
66- */
67-
68-import Ubuntu.Components 1.3
69-import Ubuntu.Components.Themes.Ambiance 1.3
70-
71-PageHeadStyle {
72- // FIXME: Don't use this but PageHeader from Ubuntu.Components 1.3.
73- id: root
74-
75- property var styledItem: root
76- property string title
77- property var config: PageHeadConfiguration {}
78- property var contents: null
79-}
80
81=== modified file 'qml/Components/ModeSwitchWarningDialog.qml'
82--- qml/Components/ModeSwitchWarningDialog.qml 2016-03-08 13:57:52 +0000
83+++ qml/Components/ModeSwitchWarningDialog.qml 2016-05-17 20:47:20 +0000
84@@ -86,7 +86,7 @@
85 Button {
86 objectName: "forceCloseButton"
87 text: i18n.tr("Close all")
88- color: UbuntuColors.red
89+ color: theme.palette.normal.negative
90 onClicked: {
91 root.forceClose();
92 }
93
94=== modified file 'qml/Components/WindowControlButtons.qml'
95--- qml/Components/WindowControlButtons.qml 2016-04-27 14:57:19 +0000
96+++ qml/Components/WindowControlButtons.qml 2016-05-17 20:47:20 +0000
97@@ -43,7 +43,7 @@
98 width: units.gu(2)
99 height: units.gu(2)
100 radius: height / 2
101- color: UbuntuColors.red
102+ color: theme.palette.normal.negative
103 visible: parent.containsMouse
104 }
105 Icon {
106
107=== modified file 'qml/Dash/DashPageHeader.qml'
108--- qml/Dash/DashPageHeader.qml 2016-04-27 15:01:10 +0000
109+++ qml/Dash/DashPageHeader.qml 2016-05-17 20:47:20 +0000
110@@ -16,7 +16,7 @@
111
112 import QtQuick 2.4
113 import Ubuntu.Components 1.3
114-import Ubuntu.Components.Themes.Ambiance 1.3
115+import Ubuntu.Components.Popups 1.3
116 import Ubuntu.Components.ListItems 1.3
117 import "../Components"
118
119@@ -78,13 +78,13 @@
120 }
121 }
122
123- function closePopup(keepFocus) {
124+ function closePopup(keepFocus, keepSearch) {
125 if (extraPanel.visible) {
126 extraPanel.visible = false;
127 } else if (!keepFocus) {
128- unfocus();
129+ unfocus(keepSearch);
130 }
131- if (!searchTextField.text && !root.navigationTag && searchHistory.count == 0) {
132+ if (!keepSearch && !searchTextField.text && !root.navigationTag && searchHistory.count == 0) {
133 headerContainer.showSearch = false;
134 }
135 }
136@@ -97,9 +97,9 @@
137 closePopup(keepFocus);
138 }
139
140- function unfocus() {
141+ function unfocus(keepSearch) {
142 searchTextField.focus = false;
143- if (!searchTextField.text && !root.navigationTag) {
144+ if (!keepSearch && !searchTextField.text && !root.navigationTag) {
145 headerContainer.showSearch = false;
146 }
147 }
148@@ -142,7 +142,7 @@
149 objectName: "headerContainer"
150 clip: contentY < height
151 anchors { left: parent.left; top: parent.top; right: parent.right }
152- height: header.contentHeight
153+ height: header.__styleInstance.contentHeight
154 contentHeight: headersColumn.height
155 interactive: false
156 contentY: showSearch ? 0 : height
157@@ -173,22 +173,18 @@
158 id: headersColumn
159 anchors { left: parent.left; right: parent.right }
160
161- PageHeadStyle {
162- // FIXME: Replace PageHeadStyle from the Ambiance theme by the new PageHeader from Ubuntu.Components 1.3.
163+ PageHeader {
164 id: searchHeader
165 anchors { left: parent.left; right: parent.right }
166 opacity: headerContainer.clip || headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout
167- __separator_visible: false
168- // Required to keep PageHeadStyle noise down as it expects the Page's properties around.
169- property var styledItem: searchHeader
170- property color dividerColor: "transparent" // Doesn't matter as we don't have PageHeadSections
171- property color panelColor: background.topColor
172- panelForegroundColor: config.foregroundColor
173- backgroundColor: "transparent"
174- config: PageHeadConfiguration {
175+
176+ StyleHints {
177 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText
178+ backgroundColor: "transparent"
179+ dividerColor: "transparent"
180 }
181- property var contents: Item {
182+
183+ contents: Item {
184 anchors.fill: parent
185
186 TextField {
187@@ -273,7 +269,7 @@
188 anchors.fill: parent
189 anchors.margins: units.gu(2)
190 name: "filters"
191- color: root.activeFiltersCount > 0 ? UbuntuColors.orange : header.config.foregroundColor
192+ color: root.activeFiltersCount > 0 ? theme.palette.normal.positive : header.__styleInstance.foregroundColor
193 }
194
195 onClicked: {
196@@ -283,6 +279,7 @@
197
198 AbstractButton {
199 id: cancelButton
200+ objectName: "cancelButton"
201 width: cancelLabel.width + cancelLabel.anchors.rightMargin + cancelLabel.anchors.leftMargin
202 anchors {
203 top: parent.top
204@@ -296,7 +293,7 @@
205 Label {
206 id: cancelLabel
207 text: i18n.tr("Cancel")
208- color: header.panelForegroundColor
209+ color: header.__styleInstance.foregroundColor
210 verticalAlignment: Text.AlignVCenter
211 anchors {
212 verticalCenter: parent.verticalCenter
213@@ -309,28 +306,27 @@
214 }
215 }
216
217- PageHeadStyle {
218- // FIXME: Replace PageHeadStyle from the Ambiance theme by the new PageHeader from Ubuntu.Components 1.3.
219+ PageHeader {
220 id: header
221 objectName: "innerPageHeader"
222 anchors { left: parent.left; right: parent.right }
223 height: headerContainer.height
224 opacity: headerContainer.clip || !headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout
225- __separator_visible: false
226- property var styledItem: header
227- property color dividerColor: "transparent" // Doesn't matter as we don't have PageHeadSections
228- property color panelColor: background.topColor
229- panelForegroundColor: config.foregroundColor
230- backgroundColor: "transparent"
231- config: PageHeadConfiguration {
232- title: root.title
233+ title: root.title
234+
235+ StyleHints {
236 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText
237- backAction: Action {
238- iconName: backIsClose ? "close" : "back"
239- visible: root.showBackButton
240- onTriggered: root.backClicked()
241- }
242-
243+ backgroundColor: "transparent"
244+ dividerColor: "transparent"
245+ }
246+
247+ leadingActionBar.actions: Action {
248+ iconName: backIsClose ? "close" : "back"
249+ visible: root.showBackButton
250+ onTriggered: root.backClicked()
251+ }
252+
253+ trailingActionBar {
254 actions: [
255 Action {
256 objectName: "store"
257@@ -366,7 +362,6 @@
258 ]
259 }
260
261- property var contents: null
262 Component.onCompleted: root.refreshLogo()
263
264 Component {
265
266=== modified file 'qml/Dash/GenericScopeView.qml'
267--- qml/Dash/GenericScopeView.qml 2016-05-04 18:08:35 +0000
268+++ qml/Dash/GenericScopeView.qml 2016-05-17 20:47:20 +0000
269@@ -662,6 +662,10 @@
270 onShowFiltersPopup: { // item
271 extraPanel.visible = false;
272 scopeView.filtersPopover = PopupUtils.open(Qt.resolvedUrl("FiltersPopover.qml"), item, { "contentWidth": scopeView.width - units.gu(2) } );
273+ scopeView.filtersPopover.Component.onDestruction.connect(function () {
274+ categoryView.pageHeader.closePopup(false, true);
275+ categoryView.pageHeader.unfocus(true); // remove the focus from the search field
276+ })
277 }
278 }
279
280@@ -683,6 +687,7 @@
281 onHistoryItemClicked: {
282 SearchHistoryModel.addQuery(text);
283 categoryView.pageHeader.searchQuery = text;
284+ categoryView.pageHeader.unfocus();
285 }
286
287 onDashNavigationLeafClicked: {
288
289=== modified file 'qml/Dash/Previews/PreviewActions.qml'
290--- qml/Dash/Previews/PreviewActions.qml 2016-04-01 13:20:27 +0000
291+++ qml/Dash/Previews/PreviewActions.qml 2016-05-17 20:47:20 +0000
292@@ -66,7 +66,7 @@
293 visible: root.actions && root.actions.length > 0
294 onTriggeredAction: root.triggered(root.widgetId, actionData.id, actionData)
295 width: (root.width - units.gu(1)) / 2
296- color: root.scopeStyle ? root.scopeStyle.previewButtonColor : UbuntuColors.orange
297+ color: root.scopeStyle ? root.scopeStyle.previewButtonColor : theme.palette.normal.positive
298 }
299 }
300 }
301
302=== modified file 'qml/Dash/Previews/PreviewPayments.qml'
303--- qml/Dash/Previews/PreviewPayments.qml 2016-02-16 20:00:47 +0000
304+++ qml/Dash/Previews/PreviewPayments.qml 2016-05-17 20:47:20 +0000
305@@ -35,7 +35,7 @@
306 id: paymentButton
307 objectName: "paymentButton"
308
309- color: UbuntuColors.orange
310+ color: theme.palette.normal.positive
311 text: paymentClient.formattedPrice
312 onClicked: {
313 paymentClient.start();
314
315=== modified file 'qml/Launcher/LauncherDelegate.qml'
316--- qml/Launcher/LauncherDelegate.qml 2016-03-29 13:51:56 +0000
317+++ qml/Launcher/LauncherDelegate.qml 2016-05-17 20:47:20 +0000
318@@ -164,7 +164,7 @@
319 }
320 width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1)))
321 height: units.gu(2)
322- backgroundColor: UbuntuColors.green
323+ backgroundColor: theme.palette.normal.positive
324 visible: root.countVisible
325 aspect: UbuntuShape.Flat
326
327@@ -207,7 +207,7 @@
328 top: parent.top
329 bottom: parent.bottom
330 }
331- backgroundColor: UbuntuColors.blue
332+ backgroundColor: theme.palette.normal.activity
333 borderSource: "none"
334 width: progressOverlay.width
335 }
336
337=== modified file 'qml/Panel/Panel.qml'
338--- qml/Panel/Panel.qml 2016-04-27 15:01:10 +0000
339+++ qml/Panel/Panel.qml 2016-05-17 20:47:20 +0000
340@@ -89,7 +89,7 @@
341
342 Rectangle {
343 id: indicatorAreaBackground
344- color: callHint.visible ? UbuntuColors.green : theme.palette.normal.background
345+ color: callHint.visible ? theme.palette.normal.positive : theme.palette.normal.background
346 anchors {
347 top: parent.top
348 left: parent.left
349
350=== modified file 'qml/Stages/DecoratedWindow.qml'
351--- qml/Stages/DecoratedWindow.qml 2016-04-27 15:01:10 +0000
352+++ qml/Stages/DecoratedWindow.qml 2016-05-17 20:47:20 +0000
353@@ -62,7 +62,7 @@
354 Rectangle {
355 anchors { left: selectionHighlight.left; right: selectionHighlight.right; bottom: selectionHighlight.bottom; }
356 height: units.dp(2)
357- color: UbuntuColors.orange
358+ color: theme.palette.normal.focus
359 visible: highlightShown
360 }
361
362
363=== modified file 'qml/Stages/DesktopSpread.qml'
364--- qml/Stages/DesktopSpread.qml 2016-04-27 11:55:12 +0000
365+++ qml/Stages/DesktopSpread.qml 2016-05-17 20:47:20 +0000
366@@ -494,7 +494,7 @@
367 // Rectangle {
368 // anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
369 // height: units.dp(2)
370- // color: UbuntuColors.orange
371+ // color: theme.palette.normal.focus
372 // visible: index == 0 // TODO: should be active workspace index
373 // }
374 }
375
376=== modified file 'qml/Stages/DesktopSpreadDelegate.qml'
377--- qml/Stages/DesktopSpreadDelegate.qml 2016-04-04 13:37:49 +0000
378+++ qml/Stages/DesktopSpreadDelegate.qml 2016-05-17 20:47:20 +0000
379@@ -83,7 +83,7 @@
380 Rectangle {
381 anchors { left: selectionHighlight.left; right: selectionHighlight.right; bottom: selectionHighlight.bottom; }
382 height: units.dp(2)
383- color: UbuntuColors.orange
384+ color: theme.palette.normal.focus
385 visible: root.highlightShown
386 antialiasing: true
387 }
388
389=== modified file 'qml/Stages/Splash.qml'
390--- qml/Stages/Splash.qml 2016-03-08 20:59:22 +0000
391+++ qml/Stages/Splash.qml 2016-05-17 20:47:20 +0000
392@@ -29,7 +29,7 @@
393 property color footerColor: d.undefinedColor
394 property alias imageSource: overlaidImage.source
395 property url icon
396- property alias title: headerConfig.title
397+ property alias title: header.title
398 property alias showHeader: header.visible
399
400 Ambiance.Palette {
401@@ -75,25 +75,13 @@
402 style: Component { MainViewStyle {theme: styledItem.fakeTheme} }
403 }
404
405- Ambiance.PageHeadStyle {
406- // FIXME: Replace PageHeadStyle by PageHeader from Ubuntu.Components 1.3.
407+ PageHeader {
408 id: header
409- anchors {
410- left: parent.left;
411- right: parent.right
412- }
413- property var styledItem: header
414- // FIXME Keep in sync with SDK's MainView.qml values of these two colors
415- property color dividerColor: Qt.darker(styledItem.backgroundColor, 1.1)
416- property color panelColor: Qt.lighter(styledItem.backgroundColor, 1.1)
417- panelForegroundColor: config.foregroundColor
418- backgroundColor: "transparent"
419- config: PageHeadConfiguration {
420- id: headerConfig
421- foregroundColor: styledItem.fakeTheme.palette.normal.backgroundText
422- }
423-
424- property var contents: null
425+ anchors { left: parent.left; right: parent.right }
426+ StyleHints {
427+ foregroundColor: styledItem.fakeTheme.palette.selected.backgroundText
428+ backgroundColor: "transparent"
429+ }
430 }
431
432 Image {
433
434=== modified file 'qml/Stages/SpreadDelegate.qml'
435--- qml/Stages/SpreadDelegate.qml 2016-04-27 15:01:10 +0000
436+++ qml/Stages/SpreadDelegate.qml 2016-05-17 20:47:20 +0000
437@@ -286,7 +286,7 @@
438 Rectangle {
439 anchors { left: selectionHighlight.left; right: selectionHighlight.right; bottom: selectionHighlight.bottom; }
440 height: units.dp(2)
441- color: UbuntuColors.orange
442+ color: theme.palette.normal.focus
443 visible: root.highlightShown
444 antialiasing: true
445 }
446
447=== modified file 'tests/plugins/Dash/tst_ScopeStyle.qml'
448--- tests/plugins/Dash/tst_ScopeStyle.qml 2016-03-29 03:47:39 +0000
449+++ tests/plugins/Dash/tst_ScopeStyle.qml 2016-05-17 20:47:20 +0000
450@@ -174,7 +174,7 @@
451
452 function test_previewButtonColor_data() {
453 return [
454- { tag: "default", index: 0, previewButtonColor: UbuntuColors.orange },
455+ { tag: "default", index: 0, previewButtonColor: theme.palette.normal.positive },
456 { tag: "red", index: 1, previewButtonColor: "red" },
457 ];
458 }
459
460=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
461--- tests/qmltests/Dash/tst_Dash.qml 2016-05-17 20:47:20 +0000
462+++ tests/qmltests/Dash/tst_Dash.qml 2016-05-17 20:47:20 +0000
463@@ -125,7 +125,7 @@
464 // Go back
465 var scopesList = findChild(dash, "scopesList");
466 var scopesListPageHeader = findChild(scopesList, "pageHeader");
467- var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
468+ var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar;
469 mouseClick(backButton);
470 tryCompare(bottomEdgeController, "progress", 0);
471 }
472@@ -200,7 +200,7 @@
473
474 // Go back
475 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
476- var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
477+ var backButton = findChild(dashTempScopeItemHeader, "innerPageHeader").leadingActionBar;
478 mouseClick(backButton);
479
480 // Check temp scope is gone
481@@ -226,7 +226,7 @@
482 // Go back
483 var scopesList = findChild(dash, "scopesList");
484 var scopesListPageHeader = findChild(scopesList, "pageHeader");
485- var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
486+ var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar;
487 mouseClick(backButton);
488 tryCompare(bottomEdgeController, "progress", 0);
489 }
490@@ -338,7 +338,7 @@
491 // Exit edit mode and go back
492 var scopesList = findChild(dash, "scopesList");
493 var scopesListPageHeader = findChild(scopesList, "pageHeader");
494- var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
495+ var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar;
496 mouseClick(backButton);
497 mouseClick(backButton);
498 tryCompare(bottomEdgeController, "progress", 0);
499@@ -383,7 +383,7 @@
500 // Exit edit mode
501 var scopesList = findChild(dash, "scopesList");
502 var scopesListPageHeader = findChild(scopesList, "pageHeader");
503- var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
504+ var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar;
505 mouseClick(backButton);
506
507 // Click on third scope
508@@ -493,7 +493,7 @@
509
510 // Go back
511 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
512- var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
513+ var backButton = findChild(dashTempScopeItemHeader, "innerPageHeader").leadingActionBar;
514 mouseClick(backButton);
515
516 // Check temp scope is gone
517@@ -561,7 +561,7 @@
518
519 // Go back
520 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
521- var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
522+ var backButton = findChild(dashTempScopeItemHeader, "innerPageHeader").leadingActionBar;
523 mouseClick(backButton);
524
525 // Check temp scope is gone
526@@ -593,7 +593,7 @@
527
528 // Go back
529 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
530- var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
531+ var backButton = findChild(dashTempScopeItemHeader, "innerPageHeader").leadingActionBar;
532 mouseClick(backButton);
533
534 // Check temp scope is gone
535
536=== modified file 'tests/qmltests/Dash/tst_DashContent.qml'
537--- tests/qmltests/Dash/tst_DashContent.qml 2016-03-29 03:47:39 +0000
538+++ tests/qmltests/Dash/tst_DashContent.qml 2016-05-17 20:47:20 +0000
539@@ -215,7 +215,7 @@
540 verify(pageHeader, "Could not find the scope page header.");
541 var innerHeader = findChild(pageHeader, "innerPageHeader");
542 verify(innerHeader, "Could not find the scope page header.");
543- compare(innerHeader.config.title, scopesModel.getScope(data.index).name);
544+ compare(innerHeader.title, scopesModel.getScope(data.index).name);
545 }
546
547 function test_is_active_data() {
548@@ -515,10 +515,18 @@
549 }
550
551 function test_navigationShowFilterPopup() {
552- goToSecondLevel();
553-
554 var dashContentList = findChild(dashContent, "dashContentList");
555+ var pageHeader = findChild(dashContentList.currentItem, "scopePageHeader")
556 var settingsButton = findChild(dashContentList.currentItem, "settingsButton");
557+ var searchButton = findChild(dashContentList.currentItem, "search_button");
558+ var cancelButton = findChild(dashContentList.currentItem, "cancelButton");
559+ var searchTextField = findChild(pageHeader, "searchTextField");
560+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
561+ var headerContainer = findChild(pageHeader, "headerContainer");
562+
563+ // test that closing the filters popover without a search unfocuses and removes the navigation
564+ mouseClick(searchButton);
565+ tryCompare(peExtraPanel, "visible", true);
566
567 var filtersPopover = findChild(shell, "filtersPopover")
568 verify(!filtersPopover);
569@@ -526,8 +534,33 @@
570 mouseClick(settingsButton);
571
572 filtersPopover = findChild(shell, "filtersPopover")
573-
574- verify(filtersPopover);
575+ verify(filtersPopover);
576+
577+ mouseClick(shell, shell.width - 1, shell.height - 1);
578+
579+ tryCompare(pageHeader.extraPanel, "visible", false);
580+ tryCompare(headerContainer, "showSearch", true);
581+ tryCompare(searchTextField, "focus", false);
582+
583+ mouseClick(cancelButton);
584+ tryCompare(headerContainer, "showSearch", false);
585+ tryCompare(headerContainer, "contentY", headerContainer.height);
586+
587+ // test within a navigation
588+ goToSecondLevel();
589+
590+ filtersPopover = findChild(shell, "filtersPopover")
591+ verify(!filtersPopover);
592+
593+ mouseClick(settingsButton);
594+
595+ filtersPopover = findChild(shell, "filtersPopover")
596+ verify(filtersPopover);
597+
598+ mouseClick(shell, shell.width - 1, shell.height - 1);
599+
600+ tryCompare(pageHeader.extraPanel, "visible", false);
601+ tryCompare(headerContainer, "showSearch", true);
602 }
603
604 function test_primaryFilter() {
605@@ -625,5 +658,31 @@
606 tryCompareFunction(function() { return dashContentList.currentItem.item.scope.id == nextScopeId; }, true);
607 compare(dashContentList.currentIndex, 0);
608 }
609+
610+ function test_extraPanel() {
611+ var dashContentList = findChild(dashContent, "dashContentList");
612+ var pageHeader = findChild(dashContentList.currentItem, "scopePageHeader")
613+ pageHeader.searchEntryEnabled = true;
614+ pageHeader.searchHistory.clear();
615+
616+ pageHeader.searchHistory.addQuery("Search1");
617+ pageHeader.searchHistory.addQuery("Search2");
618+
619+ pageHeader.triggerSearch();
620+ tryCompare(pageHeader.extraPanel, "visible", true);
621+
622+ var searchTextField = findChild(pageHeader, "searchTextField");
623+ compare(searchTextField.focus, true);
624+
625+ var recentSearches = findChild(pageHeader.extraPanel, "recentSearchesRepeater");
626+ verify(recentSearches, "Could not find recent searches");
627+
628+ waitForRendering(recentSearches);
629+
630+ mouseClick(recentSearches.itemAt(0));
631+ compare(pageHeader.searchQuery, "Search2");
632+ tryCompare(pageHeader.extraPanel, "visible", false);
633+ compare(searchTextField.focus, false);
634+ }
635 }
636 }
637
638=== modified file 'tests/qmltests/Dash/tst_DashPageHeader.qml'
639--- tests/qmltests/Dash/tst_DashPageHeader.qml 2016-03-29 03:47:39 +0000
640+++ tests/qmltests/Dash/tst_DashPageHeader.qml 2016-05-17 20:47:20 +0000
641@@ -147,30 +147,6 @@
642 doResetSearch();
643 }
644
645- function test_extraPanel() {
646- searchEnabled = true;
647- pageHeader.searchHistory.clear();
648-
649- pageHeader.searchHistory.addQuery("Search1");
650- pageHeader.searchHistory.addQuery("Search2");
651-
652- pageHeader.triggerSearch();
653-
654- tryCompare(pageHeader.extraPanel, "visible", true);
655-
656- var searchTextField = findChild(pageHeader, "searchTextField");
657- compare(searchTextField.focus, true);
658-
659- var recentSearches = findChild(pageHeader.extraPanel, "recentSearchesRepeater");
660- verify(recentSearches, "Could not find recent searches");
661- waitForRendering(recentSearches);
662- mouseClick(recentSearches.itemAt(0));
663-
664- compare(pageHeader.searchQuery, "Search2");
665- tryCompare(pageHeader.extraPanel, "visible", false);
666- compare(searchTextField.focus, false);
667- }
668-
669 function test_popup_closing_data() {
670 return [
671 { tag: "with search text", searchText: "foobar", hideSearch: false },
672
673=== modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml'
674--- tests/qmltests/Dash/tst_GenericScopeView.qml 2016-03-29 03:47:39 +0000
675+++ tests/qmltests/Dash/tst_GenericScopeView.qml 2016-05-17 20:47:20 +0000
676@@ -442,8 +442,8 @@
677
678 var innerHeader = findChild(header, "innerPageHeader");
679 verify(innerHeader, "Could not find the inner header");
680- verify(Qt.colorEqual(innerHeader.config.foregroundColor, data.foreground),
681- "Foreground color not equal: %1 != %2".arg(innerHeader.config.foregroundColor).arg(data.foreground));
682+ verify(Qt.colorEqual(innerHeader.__styleInstance.foregroundColor, data.foreground),
683+ "Foreground color not equal: %1 != %2".arg(innerHeader.__styleInstance.foregroundColor).arg(data.foreground));
684
685 var background = findChild(header, "headerBackground");
686 verify(background, "Could not find the background");
687
688=== modified file 'tests/qmltests/Dash/tst_PreviewView.qml'
689--- tests/qmltests/Dash/tst_PreviewView.qml 2016-03-29 03:47:39 +0000
690+++ tests/qmltests/Dash/tst_PreviewView.qml 2016-05-17 20:47:20 +0000
691@@ -98,7 +98,7 @@
692 var header = findChild(view, "innerPageHeader");
693 verify(header, "Could not find the preview header");
694
695- compare(header.config.title, "Mock Scope");
696+ compare(header.title, "Mock Scope");
697 }
698
699 function test_header_style() {
700@@ -107,8 +107,8 @@
701
702 var innerHeader = findChild(header, "innerPageHeader");
703 verify(innerHeader, "Could not find the inner header");
704- verify(Qt.colorEqual(innerHeader.config.foregroundColor, UbuntuColors.darkGrey),
705- "Foreground color not equal: %1 != %2".arg(innerHeader.config.foregroundColor).arg(UbuntuColors.darkGrey));
706+ verify(Qt.colorEqual(innerHeader.__styleInstance.foregroundColor, UbuntuColors.darkGrey),
707+ "Foreground color not equal: %1 != %2".arg(innerHeader.__styleInstance.foregroundColor).arg(UbuntuColors.darkGrey));
708
709 var background = findChild(header, "headerBackground");
710 verify(background, "Could not find the background");

Subscribers

People subscribed via source and target branches