QML UI: color the status bar on Android

This code is based on code from Marco Martin from the Kirigami Android
sample app. In order to simplify the QML code the QMLManager function is
there for all OSs, but it's a no-op on anything but Android.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-06-23 07:31:44 -07:00
parent b109b51f7f
commit 57e365222b
3 changed files with 39 additions and 0 deletions

View file

@ -336,6 +336,7 @@ Kirigami.ApplicationWindow {
subsurfaceTheme.lightPrimaryTextColor = "#212121"
subsurfaceTheme.backgroundColor = "#eff0f1"
subsurfaceTheme.diveListTextColor = subsurfaceTheme.lightPrimaryTextColor
manager.setStatusbarColor(subsurfaceTheme.darkPrimaryColor)
}
function pinkTheme() {
@ -347,6 +348,7 @@ Kirigami.ApplicationWindow {
subsurfaceTheme.lightPrimaryTextColor = "#212121"
subsurfaceTheme.backgroundColor = "#eff0f1"
subsurfaceTheme.diveListTextColor = subsurfaceTheme.lightPrimaryTextColor
manager.setStatusbarColor(subsurfaceTheme.darkPrimaryColor)
}
function darkTheme() {
@ -358,6 +360,7 @@ Kirigami.ApplicationWindow {
subsurfaceTheme.lightPrimaryTextColor = "#212121"
subsurfaceTheme.backgroundColor = "#000000"
subsurfaceTheme.diveListTextColor = subsurfaceTheme.primaryTextColor
manager.setStatusbarColor(subsurfaceTheme.darkPrimaryColor)
}
QtObject {
@ -383,6 +386,7 @@ Kirigami.ApplicationWindow {
Kirigami.Theme.highlighedTextColor = Qt.binding(function() { return darkPrimaryTextColor })
Kirigami.Theme.backgroundColor = Qt.binding(function() { return backgroundColor })
Kirigami.Theme.textColor = Qt.binding(function() { return diveListTextColor })
manager.setStatusbarColor(darkPrimaryColor)
}
}
property Item stackView: pageStack