refactor(settings): 改用常规关于选项卡并统一蓝色强调色

This commit is contained in:
2026-11-03 20:55:11 +08:00
parent 418fc360c6
commit 7bf8cfff19
15 changed files with 108 additions and 487 deletions
+2 -17
View File
@@ -16,21 +16,6 @@ extension AppAppearance {
}
}
extension AppearancePreferences {
var tintColor: Color {
switch accent {
case .system: .accentColor
case .blue: .blue
case .purple: .purple
case .teal: .teal
case .green: .green
case .orange: .orange
case .pink: .pink
case .custom: Color(red: red, green: green, blue: blue)
}
}
}
struct AppearanceStyle: ViewModifier {
let preferences: AppearancePreferences
var refreshContentOnChange = false
@@ -39,13 +24,13 @@ struct AppearanceStyle: ViewModifier {
private var scheme: ColorScheme { resolved == .dark ? .dark : .light }
func body(content: Content) -> some View {
content
// Settings split-view hosts can retain their previous native appearance.
// Settings native hosts can retain their previous native appearance.
// Keep state in the owning view, but replace the hosted subtree on a resolved theme change.
.id(refreshContentOnChange ? resolved : nil)
.background(WindowAppearanceBridge(choice: resolved))
.preferredColorScheme(scheme)
.environment(\.colorScheme, scheme)
.tint(preferences.tintColor)
.tint(.blue)
}
}