CtlCandidateTDK // Reset window origin on updateDisplay().
This commit is contained in:
parent
20368fcd91
commit
e5c7505bdd
|
@ -106,22 +106,27 @@ public class CtlCandidateTDK: CtlCandidate, NSWindowDelegate {
|
||||||
}
|
}
|
||||||
delegate?.candidatePairHighlightChanged(at: highlightedIndex)
|
delegate?.candidatePairHighlightChanged(at: highlightedIndex)
|
||||||
DispatchQueue.main.async { [self] in
|
DispatchQueue.main.async { [self] in
|
||||||
window.isOpaque = false
|
updateNSWindowModern(window)
|
||||||
window.backgroundColor = .clear
|
|
||||||
viewCheck: do {
|
|
||||||
viewCheckCatalina: if #available(macOS 10.15, *) {
|
|
||||||
if useCocoa { break viewCheckCatalina }
|
|
||||||
Self.thePool.update()
|
|
||||||
Self.currentView = NSHostingView(rootView: theView)
|
|
||||||
break viewCheck
|
|
||||||
}
|
|
||||||
Self.currentView = theViewCocoa
|
|
||||||
}
|
|
||||||
window.contentView = Self.currentView
|
|
||||||
window.setContentSize(Self.currentView.fittingSize)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func updateNSWindowModern(_ window: NSWindow) {
|
||||||
|
window.isOpaque = false
|
||||||
|
window.backgroundColor = .clear
|
||||||
|
viewCheck: do {
|
||||||
|
viewCheckCatalina: if #available(macOS 10.15, *) {
|
||||||
|
if useCocoa { break viewCheckCatalina }
|
||||||
|
Self.thePool.update()
|
||||||
|
Self.currentView = NSHostingView(rootView: theView)
|
||||||
|
break viewCheck
|
||||||
|
}
|
||||||
|
Self.currentView = theViewCocoa
|
||||||
|
}
|
||||||
|
window.contentView = Self.currentView
|
||||||
|
window.setContentSize(Self.currentView.fittingSize)
|
||||||
|
delegate?.resetCandidateWindowOrigin()
|
||||||
|
}
|
||||||
|
|
||||||
func updateNSWindowLegacy(_ window: NSWindow) {
|
func updateNSWindowLegacy(_ window: NSWindow) {
|
||||||
window.isOpaque = true
|
window.isOpaque = true
|
||||||
window.backgroundColor = NSColor.controlBackgroundColor
|
window.backgroundColor = NSColor.controlBackgroundColor
|
||||||
|
@ -139,6 +144,7 @@ public class CtlCandidateTDK: CtlCandidate, NSWindowDelegate {
|
||||||
Self.currentView.addSubview(viewToDraw)
|
Self.currentView.addSubview(viewToDraw)
|
||||||
window.contentView = Self.currentView
|
window.contentView = Self.currentView
|
||||||
window.setContentSize(outerSize)
|
window.setContentSize(outerSize)
|
||||||
|
delegate?.resetCandidateWindowOrigin()
|
||||||
}
|
}
|
||||||
|
|
||||||
override public func scrollWheel(with event: NSEvent) {
|
override public func scrollWheel(with event: NSEvent) {
|
||||||
|
|
Loading…
Reference in New Issue