feat(settings): 新增三语即时切换并记录验收与专项边界
This commit is contained in:
@@ -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() }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user