From 85d810119b0716686348390d096af6f1d9c04e16 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 13 Oct 2019 14:08:03 -0700 Subject: Mobile: pick icons depending on theme QML has ways to style icons - and we use that for the main theme color, but it doesn't seem to work (anymore?) for the edit and save icons. Instead of tracking down what changed there, simply switch between icons with different foreground color, depending on theme. All the other icons seem to work well in all three themes. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DiveDetails.qml | 3 ++- mobile-widgets/qml/main.qml | 6 ++++++ mobile-widgets/qml/mobile-resources.qrc | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index 6fed1355e..d766970ff 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -187,7 +187,8 @@ Kirigami.Page { actions.main: Kirigami.Action { icon { - name: state !== "view" ? ":/icons/document-save.svg" : ":/icons/document-edit.svg" + name: state !== "view" ? ":/icons" + subsurfaceTheme.iconStyle + "/document-save.svg" : + ":/icons" + subsurfaceTheme.iconStyle + "/document-edit.svg" color: subsurfaceTheme.primaryColor } text: state !== "view" ? qsTr("Save edits") : qsTr("Edit dive") diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 02d763e49..8827651a8 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -460,6 +460,7 @@ if you have network connectivity and want to sync your data to cloud storage."), subsurfaceTheme.secondaryTextColor = subsurfaceTheme.blueSecondaryTextColor manager.setStatusbarColor(subsurfaceTheme.darkerPrimaryColor) subsurfaceTheme.drawerColor = subsurfaceTheme.lightDrawerColor + subsurfaceTheme.iconStyle = "-dark" } function pinkTheme() { @@ -477,6 +478,7 @@ if you have network connectivity and want to sync your data to cloud storage."), subsurfaceTheme.secondaryTextColor = subsurfaceTheme.pinkSecondaryTextColor manager.setStatusbarColor(subsurfaceTheme.darkerPrimaryColor) subsurfaceTheme.drawerColor = subsurfaceTheme.lightDrawerColor + subsurfaceTheme.iconStyle = "" } function darkTheme() { @@ -494,6 +496,7 @@ if you have network connectivity and want to sync your data to cloud storage."), subsurfaceTheme.secondaryTextColor = subsurfaceTheme.darkSecondaryTextColor manager.setStatusbarColor(subsurfaceTheme.darkerPrimaryColor) subsurfaceTheme.drawerColor = subsurfaceTheme.darkDrawerColor + subsurfaceTheme.iconStyle = "-dark" } function setupUnits() { @@ -538,6 +541,9 @@ if you have network connectivity and want to sync your data to cloud storage."), property double headingPointSize: regularPointSize * 1.2 property double smallPointSize: regularPointSize * 0.8 + // icon Theme + property string iconStyle: "" + // colors currently in use property string currentTheme property color darkerPrimaryColor diff --git a/mobile-widgets/qml/mobile-resources.qrc b/mobile-widgets/qml/mobile-resources.qrc index eb4f91ef2..3cf536d6d 100644 --- a/mobile-widgets/qml/mobile-resources.qrc +++ b/mobile-widgets/qml/mobile-resources.qrc @@ -67,7 +67,9 @@ kirigami/icons/dialog-cancel.svg kirigami/icons/distribute-horizontal-x.svg kirigami/icons/document-edit.svg + kirigami/icons-dark/document-edit.svg kirigami/icons/document-save.svg + kirigami/icons-dark/document-save.svg kirigami/icons/go-up.svg kirigami/icons/gps.svg kirigami/icons/handle-left.svg -- cgit v1.2.3-70-g09d2