CtlCandidateTDK // Auto-close out-of-date window instances.
This commit is contained in:
parent
09e5546e9b
commit
e22941e8ae
|
@ -31,8 +31,12 @@ public class CtlCandidateTDK: CtlCandidate, NSWindowDelegate {
|
|||
public var useMouseScrolling: Bool = true
|
||||
private static var thePool: CandidatePool = .init(candidates: [])
|
||||
private static var currentView: NSView = .init()
|
||||
public static var currentWindow: NSWindow?
|
||||
public static var currentMenu: NSMenu?
|
||||
public static var currentWindow: NSWindow? {
|
||||
willSet {
|
||||
currentWindow?.orderOut(nil)
|
||||
}
|
||||
}
|
||||
|
||||
@available(macOS 10.15, *)
|
||||
private var theView: some View {
|
||||
|
@ -81,6 +85,7 @@ public class CtlCandidateTDK: CtlCandidate, NSWindowDelegate {
|
|||
|
||||
super.init(layout)
|
||||
window = panel
|
||||
Self.currentWindow = panel
|
||||
window?.delegate = self
|
||||
currentLayout = layout
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue