mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-23 00:40:59 +00:00
Theme: Refresh theme on launch if following color scheme
This commit is contained in:
parent
9f7eb4361a
commit
691b3f2667
1 changed files with 4 additions and 0 deletions
|
@ -31,6 +31,10 @@ struct ThemeApplier: ViewModifier {
|
|||
if !theme.isThemePreviouslySet {
|
||||
theme.selectedSet = colorScheme == .dark ? .iceCubeDark : .iceCubeLight
|
||||
theme.isThemePreviouslySet = true
|
||||
} else if theme.followSystemColorScheme && theme.isThemePreviouslySet,
|
||||
let sets = availableColorsSets
|
||||
.first(where: { $0.light.name == theme.selectedSet || $0.dark.name == theme.selectedSet }) {
|
||||
theme.selectedSet = colorScheme == .dark ? sets.dark.name : sets.light.name
|
||||
}
|
||||
setWindowTint(theme.tintColor)
|
||||
setBarsColor(theme.primaryBackgroundColor)
|
||||
|
|
Loading…
Reference in a new issue