mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-01-23 06:18:08 +00:00
Fix #1579
This commit is contained in:
parent
75a00907ea
commit
46df3bb7f9
4 changed files with 6 additions and 5 deletions
|
@ -233,6 +233,7 @@ struct DisplaySettingsView: View {
|
|||
Button {
|
||||
theme.followSystemColorScheme = true
|
||||
theme.selectedSet = colorScheme == .dark ? .iceCubeDark : .iceCubeLight
|
||||
theme.setColor(withName: theme.selectedSet)
|
||||
theme.avatarShape = .rounded
|
||||
theme.avatarPosition = .top
|
||||
theme.statusActionsDisplay = .full
|
||||
|
|
|
@ -245,11 +245,7 @@ import SwiftUI
|
|||
}
|
||||
}
|
||||
|
||||
public var selectedSet: ColorSetName = .iceCubeDark {
|
||||
didSet {
|
||||
setColor(withName: selectedSet)
|
||||
}
|
||||
}
|
||||
public var selectedSet: ColorSetName = .iceCubeDark
|
||||
|
||||
public static let shared = Theme()
|
||||
|
||||
|
|
|
@ -31,12 +31,14 @@ struct ThemeApplier: ViewModifier {
|
|||
// If theme is never set before set the default store. This should only execute once after install.
|
||||
if !theme.isThemePreviouslySet {
|
||||
theme.selectedSet = colorScheme == .dark ? .iceCubeDark : .iceCubeLight
|
||||
theme.setColor(withName: theme.selectedSet)
|
||||
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
|
||||
theme.setColor(withName: theme.selectedSet)
|
||||
}
|
||||
setWindowTint(theme.tintColor)
|
||||
setWindowUserInterfaceStyle(from: theme.selectedScheme)
|
||||
|
@ -57,6 +59,7 @@ struct ThemeApplier: ViewModifier {
|
|||
.first(where: { $0.light.name == theme.selectedSet || $0.dark.name == theme.selectedSet })
|
||||
{
|
||||
theme.selectedSet = newColorScheme == .dark ? sets.dark.name : sets.light.name
|
||||
theme.setColor(withName: theme.selectedSet)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -90,6 +90,7 @@ struct ThemeBoxView: View {
|
|||
theme.followSystemColorScheme = false
|
||||
}
|
||||
theme.selectedSet = color.name
|
||||
theme.setColor(withName: theme.selectedSet)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue