Update the user interface style on the main thread.
This commit is contained in:
parent
def5d84647
commit
8dbe5691e3
|
@ -111,13 +111,15 @@ private extension SceneDelegate {
|
|||
}
|
||||
|
||||
func updateUserInterfaceStyle() {
|
||||
DispatchQueue.main.async {
|
||||
switch AppDefaults.userInterfaceColorPalette {
|
||||
case .automatic:
|
||||
window!.overrideUserInterfaceStyle = .unspecified
|
||||
self.window?.overrideUserInterfaceStyle = .unspecified
|
||||
case .light:
|
||||
window!.overrideUserInterfaceStyle = .light
|
||||
self.window?.overrideUserInterfaceStyle = .light
|
||||
case .dark:
|
||||
window!.overrideUserInterfaceStyle = .dark
|
||||
self.window?.overrideUserInterfaceStyle = .dark
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue