forked from shadowfacts/Tusker
Fix secondary windows not respecting theme preference
This commit is contained in:
parent
74a30d27e8
commit
0bdcda1b23
|
@ -56,6 +56,9 @@ class AuxiliarySceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||||
window = UIWindow(windowScene: windowScene)
|
window = UIWindow(windowScene: windowScene)
|
||||||
window!.rootViewController = nav
|
window!.rootViewController = nav
|
||||||
window!.makeKeyAndVisible()
|
window!.makeKeyAndVisible()
|
||||||
|
|
||||||
|
NotificationCenter.default.addObserver(self, selector: #selector(themePrefChanged), name: .themePreferenceChanged, object: nil)
|
||||||
|
themePrefChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
func sceneWillResignActive(_ scene: UIScene) {
|
func sceneWillResignActive(_ scene: UIScene) {
|
||||||
|
@ -109,4 +112,8 @@ class AuxiliarySceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||||
@objc private func close() {
|
@objc private func close() {
|
||||||
closeWindow()
|
closeWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc private func themePrefChanged() {
|
||||||
|
window?.overrideUserInterfaceStyle = Preferences.shared.theme
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,9 @@ class ComposeSceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||||
window = UIWindow(windowScene: windowScene)
|
window = UIWindow(windowScene: windowScene)
|
||||||
window!.rootViewController = nav
|
window!.rootViewController = nav
|
||||||
window!.makeKeyAndVisible()
|
window!.makeKeyAndVisible()
|
||||||
|
|
||||||
|
NotificationCenter.default.addObserver(self, selector: #selector(themePrefChanged), name: .themePreferenceChanged, object: nil)
|
||||||
|
themePrefChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
func sceneWillResignActive(_ scene: UIScene) {
|
func sceneWillResignActive(_ scene: UIScene) {
|
||||||
|
@ -58,6 +61,10 @@ class ComposeSceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||||
return scene.userActivity
|
return scene.userActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc private func themePrefChanged() {
|
||||||
|
window?.overrideUserInterfaceStyle = Preferences.shared.theme
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ComposeSceneDelegate: ComposeHostingControllerDelegate {
|
extension ComposeSceneDelegate: ComposeHostingControllerDelegate {
|
||||||
|
|
Loading…
Reference in New Issue