Merge lp:~fboucault/ubuntu-ui-toolkit/fix_startup_theme_selection into lp:ubuntu-ui-toolkit/staging

Proposed by Florian Boucault
Status: Merged
Approved by: Tim Peeters
Approved revision: 1809
Merged at revision: 1813
Proposed branch: lp:~fboucault/ubuntu-ui-toolkit/fix_startup_theme_selection
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 31 lines (+10/-8)
1 file modified
src/Ubuntu/Components/1.3/MainViewBase.qml (+10/-8)
To merge this branch: bzr merge lp:~fboucault/ubuntu-ui-toolkit/fix_startup_theme_selection
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Tim Peeters Approve
Review via email: mp+283184@code.launchpad.net

Commit message

MainView: proceed to selecting the theme automatically at startup too.

To post a comment you must log in.
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

amd64 failures:

tst_theming.qml: Started with PID: 9410
tst_theming.qml: ********* Start testing of components *********
tst_theming.qml: Config: Using QtTest library 5.4.1, Qt 5.4.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 4.9.2)
tst_theming.qml: PASS : components::initTestCase()
tst_theming.qml: QWARN : components::test_backgroundcolor_change(Light color) file:///tmp/buildd/ubuntu-ui-toolkit-1.3.1795+16.04.20160106/qml/Ubuntu/Components/1.3/MainViewBase.qml:118: ReferenceError: selectTheme is not defined
tst_theming.qml: QWARN : components::test_backgroundcolor_change(Light color) file:///tmp/buildd/ubuntu-ui-toolkit-1.3.1795+16.04.20160106/qml/Ubuntu/Components/1.3/MainViewBase.qml:118: ReferenceError: selectTheme is not defined
tst_theming.qml: FAIL! : components::test_backgroundcolor_change(Light color) 'wait for signal paletteChanged' returned FALSE. ()
tst_theming.qml: Loc: [/tmp/buildd/ubuntu-ui-toolkit-1.3.1795+16.04.20160106/tests/unit_x11/tst_components/tst_theming.qml(54)]
tst_theming.qml: QWARN : components::test_backgroundcolor_change(Dark color) file:///tmp/buildd/ubuntu-ui-toolkit-1.3.1795+16.04.20160106/qml/Ubuntu/Components/1.3/MainViewBase.qml:118: ReferenceError: selectTheme is not defined
tst_theming.qml: FAIL! : components::test_backgroundcolor_change(Dark color) 'wait for signal paletteChanged' returned FALSE. ()
tst_theming.qml: Loc: [/tmp/buildd/ubuntu-ui-toolkit-1.3.1795+16.04.20160106/tests/unit_x11/tst_components/tst_theming.qml(54)]
tst_theming.qml: PASS : components::cleanupTestCase()
tst_theming.qml: Totals: 2 passed, 2 failed, 0 skipped, 0 blacklisted
tst_theming.qml: ********* Finished testing of components *********
tst_theming.qml: Exited with status 512
tst_theming.qml: Shutting down
DBus daemon: Shutdown
tst_theming.qml exited with 0

1809. By Florian Boucault

Fix reference error.

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

Thanks for fixing.

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Ubuntu/Components/1.3/MainViewBase.qml'
--- src/Ubuntu/Components/1.3/MainViewBase.qml 2015-12-22 09:26:26 +0000
+++ src/Ubuntu/Components/1.3/MainViewBase.qml 2016-01-19 19:00:47 +0000
@@ -105,17 +105,19 @@
105 Qt bug: https://bugreports.qt-project.org/browse/QTBUG-11712105 Qt bug: https://bugreports.qt-project.org/browse/QTBUG-11712
106 */106 */
107107
108 function selectTheme() {
109 if (mainView.backgroundColor != theme.palette.normal.background) {
110 // custom color, proceed with auto-theming
111 autoTheme.themeName = (ColorUtils.luminance(backgroundColor) >= 0.85) ?
112 "Ambiance" : "SuruDark";
113 }
114 }
115
108 Connections {116 Connections {
109 target: mainView117 target: mainView
110118 onBackgroundColorChanged: autoTheme.selectTheme()
111 onBackgroundColorChanged: {
112 if (mainView.backgroundColor != theme.palette.normal.background) {
113 // custom color, proceed with auto-theming
114 autoTheme.themeName = (ColorUtils.luminance(backgroundColor) >= 0.85) ?
115 "Ambiance" : "SuruDark";
116 }
117 }
118 }119 }
120 Component.onCompleted: autoTheme.selectTheme()
119121
120 property string themeName122 property string themeName
121 onThemeNameChanged: {123 onThemeNameChanged: {

Subscribers

People subscribed via source and target branches