CtlCandidate // Comments update.

This commit is contained in:
ShikiSuen 2022-09-27 10:14:39 +08:00
parent e6429e2639
commit 72b1099e63
1 changed files with 6 additions and 9 deletions

View File

@ -21,7 +21,7 @@ open class CtlCandidate: NSWindowController, CtlCandidateProtocol {
if #available(macOS 10.14, *), !NSApplication.isDarkMode, locale == "zh-Hant" {
colorBlendAmount = 0.15
}
// The background color of the highlightened candidate
//
switch locale {
case "zh-Hans":
result = NSColor.systemRed
@ -72,16 +72,13 @@ open class CtlCandidate: NSWindowController, CtlCandidateProtocol {
visible = false
}
/// 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.
/// - windowTopLeftPoint:
/// - heightDelta:
public func set(windowTopLeftPoint: NSPoint, bottomOutOfScreenAdjustmentHeight heightDelta: Double) {
DispatchQueue.main.async { [self] in
guard let window = window, var screenFrame = NSScreen.main?.visibleFrame else { return }
@ -106,7 +103,7 @@ open class CtlCandidate: NSWindowController, CtlCandidateProtocol {
}
}
// MARK: - Contents that are not needed to be implemented here.
// MARK: -
@available(*, unavailable)
public required init?(coder _: NSCoder) {