Improves behaviour of dark/light changes on iOS
This commit is contained in:
parent
ee69714b90
commit
b739f6dd61
|
@ -134,7 +134,9 @@ final class AppDefaults: ObservableObject {
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
AppDefaults.store.set(newValue.rawValue, forKey: Key.userInterfaceColorPalette)
|
AppDefaults.store.set(newValue.rawValue, forKey: Key.userInterfaceColorPalette)
|
||||||
objectWillChange.send()
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
|
||||||
|
self.objectWillChange.send()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ struct MainApp: App {
|
||||||
.onAppear { refreshProgress.startup() }
|
.onAppear { refreshProgress.startup() }
|
||||||
.environmentObject(refreshProgress)
|
.environmentObject(refreshProgress)
|
||||||
.environmentObject(defaults)
|
.environmentObject(defaults)
|
||||||
.modifier(PreferredColorSchemeModifier(preferredColorScheme: defaults.userInterfaceColorPalette))
|
.preferredColorScheme(AppDefaults.userInterfaceColorScheme)
|
||||||
}
|
}
|
||||||
.commands {
|
.commands {
|
||||||
CommandGroup(after: .newItem, addition: {
|
CommandGroup(after: .newItem, addition: {
|
||||||
|
|
|
@ -94,7 +94,8 @@ struct SidebarToolbarModifier: ViewModifier {
|
||||||
AddFolderView()
|
AddFolderView()
|
||||||
}
|
}
|
||||||
if viewModel.sheetToShow == .settings {
|
if viewModel.sheetToShow == .settings {
|
||||||
SettingsView().modifier(PreferredColorSchemeModifier(preferredColorScheme: defaults.userInterfaceColorPalette))
|
SettingsView()
|
||||||
|
.preferredColorScheme(AppDefaults.userInterfaceColorScheme)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue