Fix #1579
This commit is contained in:
parent
75a00907ea
commit
46df3bb7f9
@ -233,6 +233,7 @@ struct DisplaySettingsView: View {
|
|||||||
Button {
|
Button {
|
||||||
theme.followSystemColorScheme = true
|
theme.followSystemColorScheme = true
|
||||||
theme.selectedSet = colorScheme == .dark ? .iceCubeDark : .iceCubeLight
|
theme.selectedSet = colorScheme == .dark ? .iceCubeDark : .iceCubeLight
|
||||||
|
theme.setColor(withName: theme.selectedSet)
|
||||||
theme.avatarShape = .rounded
|
theme.avatarShape = .rounded
|
||||||
theme.avatarPosition = .top
|
theme.avatarPosition = .top
|
||||||
theme.statusActionsDisplay = .full
|
theme.statusActionsDisplay = .full
|
||||||
|
@ -245,11 +245,7 @@ import SwiftUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var selectedSet: ColorSetName = .iceCubeDark {
|
public var selectedSet: ColorSetName = .iceCubeDark
|
||||||
didSet {
|
|
||||||
setColor(withName: selectedSet)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static let shared = Theme()
|
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 is never set before set the default store. This should only execute once after install.
|
||||||
if !theme.isThemePreviouslySet {
|
if !theme.isThemePreviouslySet {
|
||||||
theme.selectedSet = colorScheme == .dark ? .iceCubeDark : .iceCubeLight
|
theme.selectedSet = colorScheme == .dark ? .iceCubeDark : .iceCubeLight
|
||||||
|
theme.setColor(withName: theme.selectedSet)
|
||||||
theme.isThemePreviouslySet = true
|
theme.isThemePreviouslySet = true
|
||||||
} else if theme.followSystemColorScheme, theme.isThemePreviouslySet,
|
} else if theme.followSystemColorScheme, theme.isThemePreviouslySet,
|
||||||
let sets = availableColorsSets
|
let sets = availableColorsSets
|
||||||
.first(where: { $0.light.name == theme.selectedSet || $0.dark.name == theme.selectedSet })
|
.first(where: { $0.light.name == theme.selectedSet || $0.dark.name == theme.selectedSet })
|
||||||
{
|
{
|
||||||
theme.selectedSet = colorScheme == .dark ? sets.dark.name : sets.light.name
|
theme.selectedSet = colorScheme == .dark ? sets.dark.name : sets.light.name
|
||||||
|
theme.setColor(withName: theme.selectedSet)
|
||||||
}
|
}
|
||||||
setWindowTint(theme.tintColor)
|
setWindowTint(theme.tintColor)
|
||||||
setWindowUserInterfaceStyle(from: theme.selectedScheme)
|
setWindowUserInterfaceStyle(from: theme.selectedScheme)
|
||||||
@ -57,6 +59,7 @@ struct ThemeApplier: ViewModifier {
|
|||||||
.first(where: { $0.light.name == theme.selectedSet || $0.dark.name == theme.selectedSet })
|
.first(where: { $0.light.name == theme.selectedSet || $0.dark.name == theme.selectedSet })
|
||||||
{
|
{
|
||||||
theme.selectedSet = newColorScheme == .dark ? sets.dark.name : sets.light.name
|
theme.selectedSet = newColorScheme == .dark ? sets.dark.name : sets.light.name
|
||||||
|
theme.setColor(withName: theme.selectedSet)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -90,6 +90,7 @@ struct ThemeBoxView: View {
|
|||||||
theme.followSystemColorScheme = false
|
theme.followSystemColorScheme = false
|
||||||
}
|
}
|
||||||
theme.selectedSet = color.name
|
theme.selectedSet = color.name
|
||||||
|
theme.setColor(withName: theme.selectedSet)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user