Merge lp:~tpeeters/ubuntu-ui-toolkit/fasterWindowColor into lp:ubuntu-ui-toolkit/staging
- fasterWindowColor
- Merge into staging
Status: | Merged |
---|---|
Approved by: | Timo Jyrinki |
Approved revision: | 1895 |
Merged at revision: | 1895 |
Proposed branch: | lp:~tpeeters/ubuntu-ui-toolkit/fasterWindowColor |
Merge into: | lp:ubuntu-ui-toolkit/staging |
Diff against target: |
143 lines (+35/-25) 4 files modified
src/Ubuntu/Components/Themes/Ambiance/1.3/MainViewStyle.qml (+9/-23) src/Ubuntu/Components/plugin/ucmainviewbase.cpp (+23/-1) src/Ubuntu/Components/plugin/ucmainviewbase.h (+1/-0) src/Ubuntu/Components/plugin/ucmainviewbase_p.h (+2/-1) |
To merge this branch: | bzr merge lp:~tpeeters/ubuntu-ui-toolkit/fasterWindowColor |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ubuntu-sdk-build-bot | continuous-integration | Approve | |
Zsombor Egri | Approve | ||
Review via email: mp+288661@code.launchpad.net |
Commit message
Set the window color as soon as the window is available, to avoid a flickering background when it is updated later.
Description of the change
The MainViewStyle is only needed for drawing a gradient background now, so UCMainViewBase was adapted so that it only sets the styleName if a gradient must be drawn.
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1889
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1889
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1889
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1889
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1889
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1890
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1890
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1890
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1890
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1890
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1891
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1891
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1891
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1891
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1891
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1892
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1892
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1892
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1892
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1892
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1894
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1894
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1894
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1894
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1894
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Zsombor Egri (zsombi) wrote : | # |
All right, I love it now. Let's get it in.
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
None: https:/
Timo Jyrinki (timo-jyrinki) wrote : | # |
retrying without armhf, our phones are down.
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1895
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/MainViewStyle.qml' | |||
2 | --- src/Ubuntu/Components/Themes/Ambiance/1.3/MainViewStyle.qml 2016-02-02 13:43:32 +0000 | |||
3 | +++ src/Ubuntu/Components/Themes/Ambiance/1.3/MainViewStyle.qml 2016-03-15 10:44:41 +0000 | |||
4 | @@ -47,30 +47,16 @@ | |||
5 | 47 | */ | 47 | */ |
6 | 48 | property color footerColor: styledItem.footerColor | 48 | property color footerColor: styledItem.footerColor |
7 | 49 | 49 | ||
8 | 50 | Gradient { | ||
9 | 51 | id: backgroundGradient | ||
10 | 52 | GradientStop { position: 0.0; color: mainViewStyle.headerColor } | ||
11 | 53 | GradientStop { position: 0.83; color: mainViewStyle.backgroundColor } | ||
12 | 54 | GradientStop { position: 1.0; color: mainViewStyle.footerColor } | ||
13 | 55 | } | ||
14 | 56 | |||
15 | 57 | Rectangle { | 50 | Rectangle { |
16 | 58 | id: backgroundColor | ||
17 | 59 | anchors.fill: parent | 51 | anchors.fill: parent |
33 | 60 | color: mainViewStyle.backgroundColor | 52 | // Hide the gradient if the style was loaded and afterwards the header |
34 | 61 | gradient: internals.isGradient ? backgroundGradient : null | 53 | // and footer color are set to the same value as backgroundColor. |
35 | 62 | visible: internals.isGradient | 54 | visible: mainViewStyle.backgroundColor != mainViewStyle.headerColor || |
36 | 63 | } | 55 | mainViewStyle.backgroundColor != mainViewStyle.footerColor |
37 | 64 | 56 | gradient: Gradient { | |
38 | 65 | Binding { | 57 | GradientStop { position: 0.0; color: mainViewStyle.headerColor } |
39 | 66 | target: typeof window != 'undefined' ? window : null | 58 | GradientStop { position: 0.83; color: mainViewStyle.backgroundColor } |
40 | 67 | property: "color" | 59 | GradientStop { position: 1.0; color: mainViewStyle.footerColor } |
41 | 68 | value: mainViewStyle.backgroundColor | 60 | } |
27 | 69 | } | ||
28 | 70 | |||
29 | 71 | QtObject { | ||
30 | 72 | id: internals | ||
31 | 73 | property bool isGradient: mainViewStyle.backgroundColor != mainViewStyle.headerColor || | ||
32 | 74 | mainViewStyle.backgroundColor != mainViewStyle.footerColor | ||
42 | 75 | } | 61 | } |
43 | 76 | } | 62 | } |
44 | 77 | 63 | ||
45 | === modified file 'src/Ubuntu/Components/plugin/ucmainviewbase.cpp' | |||
46 | --- src/Ubuntu/Components/plugin/ucmainviewbase.cpp 2016-02-15 14:15:37 +0000 | |||
47 | +++ src/Ubuntu/Components/plugin/ucmainviewbase.cpp 2016-03-15 10:44:41 +0000 | |||
48 | @@ -59,6 +59,8 @@ | |||
49 | 59 | // FIXME Wire this up to the application lifecycle management API instead of quit(). | 59 | // FIXME Wire this up to the application lifecycle management API instead of quit(). |
50 | 60 | qApp->quit(); | 60 | qApp->quit(); |
51 | 61 | }); | 61 | }); |
52 | 62 | |||
53 | 63 | QObject::connect(q, SIGNAL(windowChanged(QQuickWindow*)), q, SLOT(_q_updateWindow())); | ||
54 | 62 | } | 64 | } |
55 | 63 | 65 | ||
56 | 64 | void UCMainViewBasePrivate::_q_headerColorBinding(const QColor &col) | 66 | void UCMainViewBasePrivate::_q_headerColorBinding(const QColor &col) |
57 | @@ -107,6 +109,14 @@ | |||
58 | 107 | d_func()->init(); | 109 | d_func()->init(); |
59 | 108 | } | 110 | } |
60 | 109 | 111 | ||
61 | 112 | void UCMainViewBasePrivate::_q_updateWindow() | ||
62 | 113 | { | ||
63 | 114 | Q_Q(UCMainViewBase); | ||
64 | 115 | if (q->window()) { | ||
65 | 116 | q->window()->setColor(m_backgroundColor); | ||
66 | 117 | } | ||
67 | 118 | } | ||
68 | 119 | |||
69 | 110 | UCMainViewBase::UCMainViewBase(UCMainViewBasePrivate &dd, QQuickItem *parent) | 120 | UCMainViewBase::UCMainViewBase(UCMainViewBasePrivate &dd, QQuickItem *parent) |
70 | 111 | : UCPageTreeNode( dd, parent) | 121 | : UCPageTreeNode( dd, parent) |
71 | 112 | { | 122 | { |
72 | @@ -177,6 +187,11 @@ | |||
73 | 177 | { | 187 | { |
74 | 178 | Q_D(UCMainViewBase); | 188 | Q_D(UCMainViewBase); |
75 | 179 | 189 | ||
76 | 190 | // MainViewStyle is used to draw the gradient background. | ||
77 | 191 | if (d->styleName().isEmpty()) { | ||
78 | 192 | d->setStyleName(QStringLiteral("MainViewStyle")); | ||
79 | 193 | } | ||
80 | 194 | |||
81 | 180 | //disable binding to background color | 195 | //disable binding to background color |
82 | 181 | d->m_flags |= UCMainViewBasePrivate::CustomHeaderColor; | 196 | d->m_flags |= UCMainViewBasePrivate::CustomHeaderColor; |
83 | 182 | d->_q_headerColorBinding(headerColor); | 197 | d->_q_headerColorBinding(headerColor); |
84 | @@ -220,6 +235,8 @@ | |||
85 | 220 | if (!(d->m_flags & UCMainViewBasePrivate::CustomFooterColor)) | 235 | if (!(d->m_flags & UCMainViewBasePrivate::CustomFooterColor)) |
86 | 221 | d->_q_footerColorBinding(d->m_backgroundColor); | 236 | d->_q_footerColorBinding(d->m_backgroundColor); |
87 | 222 | 237 | ||
88 | 238 | d->_q_updateWindow(); | ||
89 | 239 | |||
90 | 223 | // FIXME: Define the background colors in MainViewStyle and get rid of the properties | 240 | // FIXME: Define the background colors in MainViewStyle and get rid of the properties |
91 | 224 | // in MainViewBase. That removes the need for auto-theming. | 241 | // in MainViewBase. That removes the need for auto-theming. |
92 | 225 | d->doAutoTheme(); | 242 | d->doAutoTheme(); |
93 | @@ -235,6 +252,10 @@ | |||
94 | 235 | { | 252 | { |
95 | 236 | Q_D(UCMainViewBase); | 253 | Q_D(UCMainViewBase); |
96 | 237 | 254 | ||
97 | 255 | // MainViewStyle is used to draw the gradient background. | ||
98 | 256 | if (d->styleName().isEmpty()) { | ||
99 | 257 | d->setStyleName(QStringLiteral("MainViewStyle")); | ||
100 | 258 | } | ||
101 | 238 | //disable binding to background color | 259 | //disable binding to background color |
102 | 239 | d->m_flags |= UCMainViewBasePrivate::CustomFooterColor; | 260 | d->m_flags |= UCMainViewBasePrivate::CustomFooterColor; |
103 | 240 | d->_q_footerColorBinding(footerColor); | 261 | d->_q_footerColorBinding(footerColor); |
104 | @@ -286,7 +307,6 @@ | |||
105 | 286 | { | 307 | { |
106 | 287 | Q_D(UCMainViewBase); | 308 | Q_D(UCMainViewBase); |
107 | 288 | UCPageTreeNode::componentComplete(); | 309 | UCPageTreeNode::componentComplete(); |
108 | 289 | d->setStyleName(QStringLiteral("MainViewStyle")); | ||
109 | 290 | d->doAutoTheme(); | 310 | d->doAutoTheme(); |
110 | 291 | 311 | ||
111 | 292 | if (d->m_actionContext) | 312 | if (d->m_actionContext) |
112 | @@ -312,3 +332,5 @@ | |||
113 | 312 | d->m_actionContext->classBegin(); | 332 | d->m_actionContext->classBegin(); |
114 | 313 | } | 333 | } |
115 | 314 | } | 334 | } |
116 | 335 | |||
117 | 336 | #include "moc_ucmainviewbase.cpp" | ||
118 | 315 | 337 | ||
119 | === modified file 'src/Ubuntu/Components/plugin/ucmainviewbase.h' | |||
120 | --- src/Ubuntu/Components/plugin/ucmainviewbase.h 2016-01-25 08:40:25 +0000 | |||
121 | +++ src/Ubuntu/Components/plugin/ucmainviewbase.h 2016-03-15 10:44:41 +0000 | |||
122 | @@ -79,6 +79,7 @@ | |||
123 | 79 | 79 | ||
124 | 80 | private: | 80 | private: |
125 | 81 | Q_DECLARE_PRIVATE(UCMainViewBase) | 81 | Q_DECLARE_PRIVATE(UCMainViewBase) |
126 | 82 | Q_PRIVATE_SLOT(d_func(), void _q_updateWindow()) | ||
127 | 82 | }; | 83 | }; |
128 | 83 | 84 | ||
129 | 84 | #endif // UCMAINVIEWBASE_H | 85 | #endif // UCMAINVIEWBASE_H |
130 | 85 | 86 | ||
131 | === modified file 'src/Ubuntu/Components/plugin/ucmainviewbase_p.h' | |||
132 | --- src/Ubuntu/Components/plugin/ucmainviewbase_p.h 2016-01-21 12:30:25 +0000 | |||
133 | +++ src/Ubuntu/Components/plugin/ucmainviewbase_p.h 2016-03-15 10:44:41 +0000 | |||
134 | @@ -40,7 +40,8 @@ | |||
135 | 40 | 40 | ||
136 | 41 | void _q_headerColorBinding (const QColor &col); | 41 | void _q_headerColorBinding (const QColor &col); |
137 | 42 | void _q_footerColorBinding (const QColor &col); | 42 | void _q_footerColorBinding (const QColor &col); |
139 | 43 | void doAutoTheme (); | 43 | void doAutoTheme(); |
140 | 44 | void _q_updateWindow(); | ||
141 | 44 | 45 | ||
142 | 45 | QString m_applicationName; | 46 | QString m_applicationName; |
143 | 46 | QColor m_headerColor; | 47 | QColor m_headerColor; |
One comment inline