ctlIME // +useIMKCandidateWindow.

This commit is contained in:
ShikiSuen 2022-08-12 00:32:32 +08:00
parent ba054059e8
commit fdad75434e
2 changed files with 10 additions and 8 deletions

View File

@ -25,7 +25,8 @@ class ctlInputMethod: IMKInputController {
static var areWeNerfing = false static var areWeNerfing = false
/// ///
static var ctlCandidateCurrent: ctlCandidateProtocol = ctlCandidateIMK.init(.horizontal) static var ctlCandidateCurrent: ctlCandidateProtocol =
mgrPrefs.useIMKCandidateWindow ? ctlCandidateIMK.init(.horizontal) : ctlCandidateUniversal.init(.horizontal)
/// ///
static let tooltipController = TooltipController() static let tooltipController = TooltipController()

View File

@ -66,13 +66,14 @@ extension ctlInputMethod {
/// layoutCandidateView /// layoutCandidateView
/// macOS 10.x SwiftUI /// macOS 10.x SwiftUI
if isCandidateWindowVertical { // 使 let candidateLayout: CandidateLayout =
ctlInputMethod.ctlCandidateCurrent = ctlCandidateIMK.init(.vertical) ((isCandidateWindowVertical || !mgrPrefs.useHorizontalCandidateList)
} else if mgrPrefs.useHorizontalCandidateList { ? CandidateLayout.vertical
ctlInputMethod.ctlCandidateCurrent = ctlCandidateIMK.init(.horizontal) : CandidateLayout.horizontal)
} else {
ctlInputMethod.ctlCandidateCurrent = ctlCandidateIMK.init(.vertical) ctlInputMethod.ctlCandidateCurrent =
} mgrPrefs.useIMKCandidateWindow
? ctlCandidateIMK.init(candidateLayout) : ctlCandidateUniversal.init(candidateLayout)
// set the attributes for the candidate panel (which uses NSAttributedString) // set the attributes for the candidate panel (which uses NSAttributedString)
let textSize = mgrPrefs.candidateListTextSize let textSize = mgrPrefs.candidateListTextSize