Fix appearance color bug
This commit is contained in:
parent
a0562e9e9d
commit
b5b2eb56a1
|
@ -7,6 +7,7 @@
|
||||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
class AppDelegate: NSObject, UIApplicationDelegate {
|
class AppDelegate: NSObject, UIApplicationDelegate {
|
||||||
|
@ -17,16 +18,10 @@ class AppDelegate: NSObject, UIApplicationDelegate {
|
||||||
// Lazily initialize datastack
|
// Lazily initialize datastack
|
||||||
let _ = SwiftfinStore.dataStack
|
let _ = SwiftfinStore.dataStack
|
||||||
|
|
||||||
setupAppearance()
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
|
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
|
||||||
AppDelegate.orientationLock
|
AppDelegate.orientationLock
|
||||||
}
|
}
|
||||||
|
|
||||||
private func setupAppearance() {
|
|
||||||
// UIApplication.shared.windows.first?.overrideUserInterfaceStyle = appAppearance.style
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,12 @@ struct JellyfinPlayerApp: App {
|
||||||
|
|
||||||
var body: some Scene {
|
var body: some Scene {
|
||||||
WindowGroup {
|
WindowGroup {
|
||||||
EmptyView()
|
// TODO: Replace with a SplashView
|
||||||
|
Color(appAppearance.style == .dark ? UIColor.black : UIColor.white)
|
||||||
|
.ignoresSafeArea()
|
||||||
|
.onAppear {
|
||||||
|
setupAppearance()
|
||||||
|
}
|
||||||
.withHostingWindow { window in
|
.withHostingWindow { window in
|
||||||
window?.rootViewController = PreferenceUIHostingController(wrappedView: MainCoordinator().view())
|
window?.rootViewController = PreferenceUIHostingController(wrappedView: MainCoordinator().view())
|
||||||
}
|
}
|
||||||
|
@ -30,6 +35,10 @@ struct JellyfinPlayerApp: App {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func setupAppearance() {
|
||||||
|
UIApplication.shared.windows.first?.overrideUserInterfaceStyle = appAppearance.style
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Hosting Window
|
// MARK: Hosting Window
|
||||||
|
|
Loading…
Reference in New Issue