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
@@ -3,6 +3,7 @@ import AppKit
/// A non-activating child window: outside the parent layout, below no other app.
struct HoverDetailPresenter<Detail: View>: NSViewRepresentable {
@Environment(\.locale) private var locale
let isPresented: Bool
let detail: Detail
let onHover: (Bool) -> Void
@@ -10,7 +11,7 @@ struct HoverDetailPresenter<Detail: View>: NSViewRepresentable {
func makeNSView(context: Context) -> AnchorView { AnchorView() }
func updateNSView(_ view: AnchorView, context: Context) {
view.configure(presented: isPresented, detail: AnyView(detail), onHover: onHover, onDismiss: onDismiss)
view.configure(presented: isPresented, detail: AnyView(detail.environment(\.locale, locale)), onHover: onHover, onDismiss: onDismiss)
}
static func dismantleNSView(_ view: AnchorView, coordinator: ()) { view.detach() }