fix(settings): 修复主题切换后窗口与表单深浅混用

This commit is contained in:
2026-11-03 13:20:05 +08:00
parent 92e8187038
commit d81825ba8c
4 changed files with 17 additions and 8 deletions
@@ -46,7 +46,7 @@ struct AppearanceSettingsView: View {
}
.onChange(of: selection) { _, _ in colorPicker.close() }
.frame(minWidth: 720, idealWidth: 780, minHeight: 460, idealHeight: 540)
.modifier(AppearanceStyle(preferences: preferences))
.modifier(AppearanceStyle(preferences: preferences, refreshContentOnChange: true))
}
private var selectedPage: SettingsPage { selection ?? .appearance }
@@ -164,13 +164,8 @@ private struct LiquidAppearancePicker: View {
HStack(spacing: 4) {
ForEach(AppAppearance.allCases) { appearance in
Button {
if reduceMotion {
selection = appearance
} else {
withAnimation(.smooth(duration: 0.24)) {
selection = appearance
}
}
// Theme changes must not animate the native split view / Form hierarchy.
selection = appearance
} label: {
Label(appearance.title, systemImage: appearance.symbol)
.labelStyle(.titleAndIcon)
@@ -196,6 +191,7 @@ private struct LiquidAppearancePicker: View {
.padding(4)
.glassEffect(.regular, in: .capsule)
}
.animation(reduceMotion ? nil : .smooth(duration: 0.24), value: selection)
.accessibilityElement(children: .contain)
.accessibilityLabel(Text("appearance.title"))
}