Fix accent colour not being applied to Alerts etc. (#701)

This commit is contained in:
Doug
2023-03-14 13:38:36 +00:00
committed by GitHub
parent 8a069ecfa5
commit 1a81768c62
21 changed files with 20 additions and 50 deletions
@@ -22,6 +22,10 @@ struct Application: App {
private let applicationCoordinator: AppCoordinatorProtocol
init() {
// Set the tint colour app-wide. Using UIView ensures that alerts, confirmation dialogs
// and Xcode previews all take on the tint colour, similar to defining it in an asset catalog.
UIView.appearance().tintColor = .element.accent
if Tests.isRunningUITests {
applicationCoordinator = UITestsAppCoordinator()
} else {
@@ -35,7 +39,6 @@ struct Application: App {
EmptyView()
} else {
applicationCoordinator.toPresentable()
.accentColor(.element.accent)
.task {
applicationCoordinator.start()
}
@@ -371,11 +371,9 @@ private struct NavigationSplitCoordinatorView: View {
// through the NavigationSplitCoordinator as well.
.sheet(item: $navigationSplitCoordinator.sheetModule) { module in
module.coordinator?.toPresentable()
.tint(.element.accent)
}
.fullScreenCover(item: $navigationSplitCoordinator.fullScreenCoverModule) { module in
module.coordinator?.toPresentable()
.tint(.element.accent)
}
}
@@ -666,11 +664,9 @@ private struct NavigationStackCoordinatorView: View {
}
.sheet(item: $navigationStackCoordinator.sheetModule) { module in
module.coordinator?.toPresentable()
.tint(.element.accent)
}
.fullScreenCover(item: $navigationStackCoordinator.fullScreenCoverModule) { module in
module.coordinator?.toPresentable()
.tint(.element.accent)
}
}
}