From d9661a7be8c5ecfd0daf7c907ec85d7c6c68c19b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 22 Dec 2020 15:02:39 -0800 Subject: [PATCH] mobile/UI: initialize Kirigami theme to use our colors With this we should finally get the correct button colors even when switching color theme. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DiveDetails.qml | 5 +++++ mobile-widgets/qml/DiveList.qml | 7 ++++++- mobile-widgets/qml/TripDetails.qml | 7 +++++++ mobile-widgets/qml/main.qml | 7 +++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index 02d693b7e..859387ae0 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -58,7 +58,12 @@ Kirigami.Page { bottomPadding: 0 background: Rectangle { color: subsurfaceTheme.backgroundColor } width: rootItem.colWidth + + // we want to use our own colors for Kirigami, so let's define our colorset + Kirigami.Theme.inherit: false + Kirigami.Theme.colorSet: Kirigami.Theme.Button Kirigami.Theme.backgroundColor: subsurfaceTheme.backgroundColor + Kirigami.Theme.textColor: subsurfaceTheme.textColor property QtObject removeDiveFromTripAction: Kirigami.Action { text: qsTr ("Remove this dive from trip") diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index 138b807e8..0806a8bee 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -14,7 +14,12 @@ Kirigami.ScrollablePage { verticalScrollBarPolicy: Qt.ScrollBarAlwaysOff property int dlHorizontalPadding: Kirigami.Units.gridUnit / 2 - Kirigami.Units.smallSpacing + 1 property QtObject diveListModel: null - Kirigami.Theme.backgroundColor: subsurfaceTheme.backgroundColor // used for background of left and right action button + // we want to use our own colors for Kirigami, so let's define our colorset + Kirigami.Theme.inherit: false + Kirigami.Theme.colorSet: Kirigami.Theme.Button + Kirigami.Theme.backgroundColor: subsurfaceTheme.backgroundColor + Kirigami.Theme.textColor: subsurfaceTheme.textColor + supportsRefreshing: true onRefreshingChanged: { if (refreshing) { diff --git a/mobile-widgets/qml/TripDetails.qml b/mobile-widgets/qml/TripDetails.qml index 482dad12c..88a4385a5 100644 --- a/mobile-widgets/qml/TripDetails.qml +++ b/mobile-widgets/qml/TripDetails.qml @@ -16,6 +16,13 @@ Kirigami.Page { state: "view" padding: Kirigami.Units.largeSpacing background: Rectangle { color: subsurfaceTheme.backgroundColor } + + // we want to use our own colors for Kirigami, so let's define our colorset + Kirigami.Theme.inherit: false + Kirigami.Theme.colorSet: Kirigami.Theme.Button + Kirigami.Theme.backgroundColor: subsurfaceTheme.backgroundColor + Kirigami.Theme.textColor: subsurfaceTheme.textColor + actions.main: saveAction actions.right: cancelAction onVisibleChanged: { diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 26a2f6cf5..4f5344275 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -22,6 +22,13 @@ Kirigami.ApplicationWindow { font: Qt.application.font background: Rectangle { color: subsurfaceTheme.backgroundColor } + // we want to use our own colors for Kirigami, so let's define our colorset + Kirigami.Theme.inherit: false + Kirigami.Theme.colorSet: Kirigami.Theme.Button + Kirigami.Theme.backgroundColor: subsurfaceTheme.backgroundColor + Kirigami.Theme.textColor: subsurfaceTheme.textColor + + // next setup the tab bar on top pageStack.globalToolBar.style: Kirigami.ApplicationHeaderStyle.Breadcrumb pageStack.globalToolBar.showNavigationButtons: (Kirigami.ApplicationHeaderStyle.ShowBackButton | Kirigami.ApplicationHeaderStyle.ShowForwardButton) pageStack.globalToolBar.minimumHeight: 0