TabView indicator points change now their color when system color changed

This commit is contained in:
Arnfried Griesert
2024-03-08 12:59:30 +01:00
parent 9f6fff8270
commit cbe74bc98d

View File

@@ -28,13 +28,15 @@ struct IntroduceFederationView: View {
static let topConstraintTitle: CGFloat = 390 static let topConstraintTitle: CGFloat = 390
@EnvironmentObject var themeService: BWIThemeService @EnvironmentObject var themeService: BWIThemeService
@State var visibleScreen = VisibleScreen.screen1 @State var visibleScreen = VisibleScreen.screen1
@State var redrawKey = UUID()
var body: some View { var body: some View {
TabView(selection: $visibleScreen) { TabView(selection: $visibleScreen) {
IntroduceFederationScreen1().tag(VisibleScreen.screen1).navigationBarHidden(true) IntroduceFederationScreen1().tag(VisibleScreen.screen1).navigationBarHidden(true)
IntroduceFederationScreen2().tag(VisibleScreen.screen2).navigationBarHidden(true) IntroduceFederationScreen2().tag(VisibleScreen.screen2).navigationBarHidden(true)
IntroduceFederationScreen3().tag(VisibleScreen.screen3).navigationBarHidden(true) IntroduceFederationScreen3().tag(VisibleScreen.screen3).navigationBarHidden(true)
} }
.id(redrawKey)
.tabViewStyle(.page(indexDisplayMode: .always)) .tabViewStyle(.page(indexDisplayMode: .always))
.background { .background {
Color(themeService.theme.backgroundColor) Color(themeService.theme.backgroundColor)
@@ -63,6 +65,10 @@ struct IntroduceFederationView: View {
.onAppear { .onAppear {
setupIndicatorColors() setupIndicatorColors()
} }
.onChange(of: themeService.isCurrentThemeDark) { _ in
setupIndicatorColors()
redrawKey = UUID()
}
} }
private func setupIndicatorColors() { private func setupIndicatorColors() {