feat(settings): 新增三语即时切换并记录验收与专项边界
This commit is contained in:
@@ -5,14 +5,15 @@ import AppKit
|
||||
struct CustomColorWell: NSViewRepresentable {
|
||||
let preferences: AppearancePreferences
|
||||
let picker: CustomColorPicker
|
||||
@Environment(\.locale) private var locale
|
||||
|
||||
func makeNSView(context: Context) -> SwatchButton {
|
||||
let button = SwatchButton()
|
||||
button.setAccessibilityLabel(String(localized: "accent.custom"))
|
||||
return button
|
||||
}
|
||||
|
||||
func updateNSView(_ button: SwatchButton, context: Context) {
|
||||
button.setAccessibilityLabel(AppLocalization.string("accent.custom", locale: locale))
|
||||
button.open = { picker.show(for: preferences) }
|
||||
button.swatchColor = NSColor(srgbRed: preferences.red, green: preferences.green, blue: preferences.blue, alpha: 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user