Zonble: Reload cand. data when CandidateControllerDelegate did set
Co-Authored-By: Weizhong Yang a.k.a zonble <zonble@gmail.com>
This commit is contained in:
parent
acc5734abe
commit
7be819076d
|
@ -17,7 +17,11 @@ public protocol CandidateControllerDelegate: AnyObject {
|
|||
|
||||
@objc(VTCandidateController)
|
||||
public class CandidateController: NSWindowController {
|
||||
@objc public weak var delegate: CandidateControllerDelegate?
|
||||
@objc public weak var delegate: CandidateControllerDelegate? {
|
||||
didSet {
|
||||
reloadData()
|
||||
}
|
||||
}
|
||||
@objc public var selectedCandidateIndex: UInt = UInt.max
|
||||
@objc public var visible: Bool = false {
|
||||
didSet {
|
||||
|
@ -69,6 +73,16 @@ public class CandidateController: NSWindowController {
|
|||
UInt.max
|
||||
}
|
||||
|
||||
/// Sets the location of the candidate window.
|
||||
///
|
||||
/// Please note that the method has side effects that modifies
|
||||
/// `windowTopLeftPoint` to make the candidate window to stay in at least
|
||||
/// in a screen.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - windowTopLeftPoint: The given location.
|
||||
/// - height: The height that helps the window not to be out of the bottom
|
||||
/// of a screen.
|
||||
@objc(setWindowTopLeftPoint:bottomOutOfScreenAdjustmentHeight:)
|
||||
public func set(windowTopLeftPoint: NSPoint, bottomOutOfScreenAdjustmentHeight height: CGFloat) {
|
||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now()) {
|
||||
|
|
Loading…
Reference in New Issue