feat(settings): 新增三语即时切换并记录验收与专项边界

This commit is contained in:
2026-10-30 01:30:50 +08:00
parent a871d7046e
commit 1cb67b86e8
18 changed files with 285 additions and 11 deletions
@@ -4,10 +4,20 @@ import AppKit
/// B-stage appearance controls; general/modules/permissions remain D-stage work.
struct AppearanceSettingsView: View {
@Bindable var preferences: AppearancePreferences
@Bindable var language: LanguagePreferences
@Environment(\.locale) private var locale
@State private var colorPicker = CustomColorPicker()
var body: some View {
Form {
Section("settings.language") {
Picker("language.title", selection: $language.language) {
Text("language.system").tag(AppLanguage.system)
Text(verbatim: "简体中文").tag(AppLanguage.simplifiedChinese)
Text(verbatim: "繁體中文").tag(AppLanguage.traditionalChinese)
Text(verbatim: "English").tag(AppLanguage.english)
}
}
Section("settings.appearance") {
Picker("appearance.title", selection: $preferences.appearance) {
Text("appearance.system").tag(AppAppearance.system)
@@ -35,7 +45,7 @@ struct AppearanceSettingsView: View {
}
}
}
.background(SettingsWindowLifecycle(onClose: { colorPicker.close() }))
.background(SettingsWindowLifecycle(title: AppLocalization.string("settings.title", locale: locale), onClose: { colorPicker.close() }))
.onChange(of: preferences.accent) { _, choice in
if choice == .custom {
Task { @MainActor in
@@ -48,7 +58,7 @@ struct AppearanceSettingsView: View {
}
.onAppear { NSApp.setActivationPolicy(.regular); NSApp.activate() }
.formStyle(.grouped)
.frame(width: 420, height: 240)
.frame(width: 460, height: 340)
.modifier(AppearanceStyle(preferences: preferences))
}