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
@EnvironmentObject var themeService: BWIThemeService
@State var visibleScreen = VisibleScreen.screen1
@State var redrawKey = UUID()
var body: some View {
TabView(selection: $visibleScreen) {
IntroduceFederationScreen1().tag(VisibleScreen.screen1).navigationBarHidden(true)
IntroduceFederationScreen2().tag(VisibleScreen.screen2).navigationBarHidden(true)
IntroduceFederationScreen3().tag(VisibleScreen.screen3).navigationBarHidden(true)
}
.id(redrawKey)
.tabViewStyle(.page(indexDisplayMode: .always))
.background {
Color(themeService.theme.backgroundColor)
@@ -63,6 +65,10 @@ struct IntroduceFederationView: View {
.onAppear {
setupIndicatorColors()
}
.onChange(of: themeService.isCurrentThemeDark) { _ in
setupIndicatorColors()
redrawKey = UUID()
}
}
private func setupIndicatorColors() {