mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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 <dirk@hohndel.org>
This commit is contained in:
parent
804a5be71f
commit
85d810119b
4 changed files with 13 additions and 1 deletions
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -67,7 +67,9 @@
|
|||
<file alias="icons/dialog-cancel.svg">kirigami/icons/dialog-cancel.svg</file>
|
||||
<file alias="icons/distribute-horizontal-x.svg">kirigami/icons/distribute-horizontal-x.svg</file>
|
||||
<file alias="icons/document-edit.svg">kirigami/icons/document-edit.svg</file>
|
||||
<file alias="icons-dark/document-edit.svg">kirigami/icons-dark/document-edit.svg</file>
|
||||
<file alias="icons/document-save.svg">kirigami/icons/document-save.svg</file>
|
||||
<file alias="icons-dark/document-save.svg">kirigami/icons-dark/document-save.svg</file>
|
||||
<file alias="icons/go-up.svg">kirigami/icons/go-up.svg</file>
|
||||
<file alias="icons/gps.svg">kirigami/icons/gps.svg</file>
|
||||
<file alias="icons/handle-left.svg">kirigami/icons/handle-left.svg</file>
|
||||
|
|
|
@ -30,6 +30,7 @@ BREEZE=../breeze-icons
|
|||
|
||||
rm -rf $MC
|
||||
mkdir -p $MC/icons
|
||||
mkdir -p $MC/icons-dark
|
||||
cp -R $PMMC/* $MC/
|
||||
|
||||
cp $BREEZE/icons/actions/22/map-globe.svg $MC/icons
|
||||
|
@ -37,6 +38,8 @@ cp $BREEZE/icons/actions/24/dialog-cancel.svg $MC/icons
|
|||
cp $BREEZE/icons/actions/24/distribute-horizontal-x.svg $MC/icons
|
||||
cp $BREEZE/icons/actions/24/document-edit.svg $MC/icons
|
||||
cp $BREEZE/icons/actions/24/document-save.svg $MC/icons
|
||||
cp $BREEZE/icons-dark/actions/24/document-edit.svg $MC/icons-dark
|
||||
cp $BREEZE/icons-dark/actions/24/document-save.svg $MC/icons-dark
|
||||
cp $BREEZE/icons/actions/24/go-next.svg $MC/icons
|
||||
cp $BREEZE/icons/actions/24/go-previous.svg $MC/icons
|
||||
cp $BREEZE/icons/actions/24/go-up.svg $MC/icons
|
||||
|
|
Loading…
Reference in a new issue