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
1=== modified file 'src/Ubuntu/Components/1.3/MainViewBase.qml'
2--- src/Ubuntu/Components/1.3/MainViewBase.qml 2015-12-22 09:26:26 +0000
3+++ src/Ubuntu/Components/1.3/MainViewBase.qml 2016-01-19 19:00:47 +0000
4@@ -105,17 +105,19 @@
5 Qt bug: https://bugreports.qt-project.org/browse/QTBUG-11712
6 */
7
8+ function selectTheme() {
9+ if (mainView.backgroundColor != theme.palette.normal.background) {
10+ // custom color, proceed with auto-theming
11+ autoTheme.themeName = (ColorUtils.luminance(backgroundColor) >= 0.85) ?
12+ "Ambiance" : "SuruDark";
13+ }
14+ }
15+
16 Connections {
17 target: mainView
18-
19- onBackgroundColorChanged: {
20- if (mainView.backgroundColor != theme.palette.normal.background) {
21- // custom color, proceed with auto-theming
22- autoTheme.themeName = (ColorUtils.luminance(backgroundColor) >= 0.85) ?
23- "Ambiance" : "SuruDark";
24- }
25- }
26+ onBackgroundColorChanged: autoTheme.selectTheme()
27 }
28+ Component.onCompleted: autoTheme.selectTheme()
29
30 property string themeName
31 onThemeNameChanged: {

Subscribers

People subscribed via source and target branches