Theme: Refresh theme on launch if following color scheme
This commit is contained in:
parent
9f7eb4361a
commit
691b3f2667
|
@ -31,6 +31,10 @@ struct ThemeApplier: ViewModifier {
|
||||||
if !theme.isThemePreviouslySet {
|
if !theme.isThemePreviouslySet {
|
||||||
theme.selectedSet = colorScheme == .dark ? .iceCubeDark : .iceCubeLight
|
theme.selectedSet = colorScheme == .dark ? .iceCubeDark : .iceCubeLight
|
||||||
theme.isThemePreviouslySet = true
|
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)
|
setWindowTint(theme.tintColor)
|
||||||
setBarsColor(theme.primaryBackgroundColor)
|
setBarsColor(theme.primaryBackgroundColor)
|
||||||
|
|
Loading…
Reference in New Issue