Fix #36: Tab-Bar-Flicker in dunklen Themes behoben

toolbarBackground/toolbarColorScheme von jedem einzelnen Tab auf das
TabView selbst verschoben. Per-Tab-Modifikatoren verursachten beim
Tab-Wechsel ein weißes Aufblitzen, da die Styles nur für den jeweils
aktiven Tab galten und beim Wechsel kurz verloren gingen.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-23 13:45:00 +02:00
parent 8427f55f21
commit 8af0309580
+5 -12
View File
@@ -38,32 +38,25 @@ struct ContentView: View {
TabView(selection: $selectedTab) {
TodayView()
.tabItem { Label("Heute", systemImage: "sun.max") }
.toolbarBackground(theme.backgroundPrimary.opacity(0.88), for: .tabBar)
.toolbarBackground(.visible, for: .tabBar)
.toolbarColorScheme(theme.id.isDark ? .dark : .light, for: .tabBar)
.tag(0)
PeopleListView()
.tabItem { Label("Menschen", systemImage: "person.2") }
.toolbarBackground(theme.backgroundPrimary.opacity(0.88), for: .tabBar)
.toolbarBackground(.visible, for: .tabBar)
.toolbarColorScheme(theme.id.isDark ? .dark : .light, for: .tabBar)
.tag(1)
IchView()
.tabItem { Label("Ich", systemImage: "person.circle") }
.toolbarBackground(theme.backgroundPrimary.opacity(0.88), for: .tabBar)
.toolbarBackground(.visible, for: .tabBar)
.toolbarColorScheme(theme.id.isDark ? .dark : .light, for: .tabBar)
.tag(2)
SettingsView()
.tabItem { Label("Einstellungen", systemImage: "gearshape") }
.toolbarBackground(theme.backgroundPrimary.opacity(0.88), for: .tabBar)
.toolbarBackground(.visible, for: .tabBar)
.toolbarColorScheme(theme.id.isDark ? .dark : .light, for: .tabBar)
.tag(3)
}
// Tab-Bar-Styling einmalig auf TabView statt auf jedem Tab setzen
// verhindert weißes Aufblitzen beim Tab-Wechsel (Issue #36)
.toolbarBackground(theme.backgroundPrimary.opacity(0.92), for: .tabBar)
.toolbarBackground(.visible, for: .tabBar)
.toolbarColorScheme(theme.id.isDark ? .dark : .light, for: .tabBar)
.fullScreenCover(isPresented: $showingNahbarOnboarding) {
OnboardingContainerView {
nahbarOnboardingDone = true