fix(settings): 修复主题切换后窗口与表单深浅混用
This commit is contained in:
@@ -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"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user