on xenial help sign in
[Dash] Add gsetting to disable/enable background
commit0537f5cfc97746da3a817ce1d5c0c752b5a23b78 authorMarius Gripsgard <mariogrip@ubuntu.com> dateMon 31 Jul 2017, 21:31 (9 years ago) parentfe5a6c3
2 files changed+21−8
plugins/Dash/ScopeStyle.qml+12−6 qml/Dash/DashBackground.qml+9−2
plugins/Dash/ScopeStyle.qml+12−6
@@ -16,6 +16,7 @@
1616
1717import QtQuick 2.4
1818import Utils 0.1
19+import GSettings 1.0
1920import Ubuntu.Components 1.3
2021import Ubuntu.Components.Themes 1.3
2122
@@ -27,17 +28,22 @@ import Ubuntu.Components.Themes 1.3
2728 */
2829
2930QtObject {
31+
32+ property var gsettings: GSettings {
33+ schema.id: "com.ubuntu.touch.system-settings"
34+ }
35+
3036 /// Style object passed from the scope
3137 property var style: Object()
3238
3339 /// Color used for text and symbolic icons
34− readonly property color foreground: "white"
40+ property color foreground: gsettings.dashBackground ? "white" : d.defaultDark
3541
3642 /// Luminance of the foreground color
3743 readonly property real foregroundLuminance: foreground ? Style.luminance(foreground) : Style.luminance(d.defaultDark)
3844
3945 /// Color used for the overall background
40− readonly property color background: "background-color" in style ? style["background-color"] : "transparent"
46+ property color background: "background-color" in style ? style["background-color"] : gsettings.dashBackground ? "transparent" : "#00f5f5f5"
4147
4248 /// Luminance of the background color
4349 readonly property real backgroundLuminance: background ? Style.luminance(background) : Style.luminance(d.defaultLight)
@@ -59,16 +65,16 @@ QtObject {
5965 readonly property url headerLogo: "logo" in d.headerStyle ? d.headerStyle["logo"] : ""
6066
6167 /// Background style for the header
62− readonly property url headerBackground: "background" in d.headerStyle ? d.headerStyle["background"] : "color:///transparent"
68+ property url headerBackground: "background" in d.headerStyle ? d.headerStyle["background"] : gsettings.dashBackground ? "color:///transparent" : "color:///#ffffff"
6369
6470 /// Foreground color for the header
65− readonly property color headerForeground: "foreground-color" in d.headerStyle ? d.headerStyle["foreground-color"] : "white"
71+ property color headerForeground: "foreground-color" in d.headerStyle ? d.headerStyle["foreground-color"] : gsettings.dashBackground ? "white" : foreground
6672
6773 /// Color of the header divider
68− readonly property color headerDividerColor: "divider-color" in d.headerStyle ? d.headerStyle["divider-color"] : "transparent"
74+ property color headerDividerColor: "divider-color" in d.headerStyle ? d.headerStyle["divider-color"] : gsettings.dashBackground ? "transparent" : "#e0e0e0"
6975
7076 /// Background style for the navigation
71− readonly property url navigationBackground: "navigation-background" in d.headerStyle ? d.headerStyle["navigation-background"] : "color:///white"
77+ property url navigationBackground: "navigation-background" in d.headerStyle ? d.headerStyle["navigation-background"] : gsettings.dashBackground ? "color:///white" : "color:///#f5f5f5"
7278
7379 /// Color of the primary preview button
7480 readonly property color previewButtonColor: "preview-button-color" in style ? style["preview-button-color"] : theme.palette.normal.positive
qml/Dash/DashBackground.qml+9−2
@@ -18,14 +18,21 @@ import QtQuick 2.4
1818import QtQuick.Window 2.2
1919import AccountsService 0.1
2020import ImageCache 0.1
21+import GSettings 1.0
2122
2223Rectangle {
23− color: "black"
24+ GSettings {
25+ id: settings
26+ schema.id: "com.ubuntu.touch.system-settings"
27+ }
28+
29+ color: settings.dashBackground ? "black" : "white"
2430
2531 Image {
32+ visible: settings.dashBackground
2633 source: AccountsService.backgroundFile
2734 anchors.fill: parent
2835 fillMode: Image.PreserveAspectCrop
2936 opacity: 0.6
3037 }
31−}
38+}