diff --git a/nahbar/nahbar/NahbarApp.swift b/nahbar/nahbar/NahbarApp.swift index 0b82efc..c873905 100644 --- a/nahbar/nahbar/NahbarApp.swift +++ b/nahbar/nahbar/NahbarApp.swift @@ -104,6 +104,9 @@ struct NahbarApp: App { .animation(.easeInOut(duration: 0.40), value: showSplash) .environment(\.nahbarTheme, activeTheme) .tint(activeTheme.accent) + // Zwingt das System in den richtigen Light/Dark-Modus für das aktive Theme – + // dadurch passt Liquid Glass (Tab-Bar, Sheets, Alerts) automatisch korrekt an. + .preferredColorScheme(activeTheme.id.isDark ? .dark : .light) .onAppear { NahbarApp.applyTabBarAppearance(activeTheme) cloudSyncMonitor.startMonitoring(iCloudEnabled: icloudSyncEnabled) @@ -132,32 +135,12 @@ struct NahbarApp: App { applyTabBarAppearance(NahbarTheme.theme(for: themeID)) } - /// Setzt UITabBar- und UINavigationBar-Appearance für das gegebene Theme. - /// Statisch, damit AppDelegate und Theme-Change-Handler dieselbe Logik nutzen. - /// configureWithOpaqueBackground() verhindert das weiße Aufblitzen bei dunklen Themes. + /// Setzt UINavigationBar-Appearance für das gegebene Theme. + /// Hinweis: UITabBarAppearance wird bewusst NICHT gesetzt – in iOS 26 übernimmt + /// Liquid Glass die Tab-Bar automatisch; eigene Hintergründe interferieren damit. static func applyTabBarAppearance(_ theme: NahbarTheme) { - let bg = UIColor(theme.backgroundPrimary) // vollständig opak – kein Bleed-through - let normal = UIColor(theme.contentTertiary) - let selected = UIColor(theme.accent) - let border = UIColor(theme.borderSubtle) - - let item = UITabBarItemAppearance() - item.normal.iconColor = normal - item.normal.titleTextAttributes = [.foregroundColor: normal] - item.selected.iconColor = selected - item.selected.titleTextAttributes = [.foregroundColor: selected] - - let tabAppearance = UITabBarAppearance() - tabAppearance.configureWithOpaqueBackground() // statt transparent – stabil bei dunklen Themes - tabAppearance.backgroundColor = bg - tabAppearance.shadowColor = border - tabAppearance.stackedLayoutAppearance = item - tabAppearance.inlineLayoutAppearance = item - tabAppearance.compactInlineLayoutAppearance = item - - UITabBar.appearance().standardAppearance = tabAppearance - UITabBar.appearance().scrollEdgeAppearance = tabAppearance - + let border = UIColor(theme.borderSubtle) + let selected = UIColor(theme.accent) let navBg = UIColor(theme.backgroundPrimary) let titleColor = UIColor(theme.contentPrimary)