From 777870a1d3663e295250772f82d40b27205f7941 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 19 Feb 2023 14:00:25 +0800 Subject: [PATCH] SessionCtl // Bind candidateWindowShowOnlyOneLine, etc. - Also unseal reverse lookups to all conditions. --- Source/Modules/SessionCtl_Delegates.swift | 4 +--- Source/Modules/SessionCtl_HandleDisplay.swift | 9 ++++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/Modules/SessionCtl_Delegates.swift b/Source/Modules/SessionCtl_Delegates.swift index 37305b5c..74080b33 100644 --- a/Source/Modules/SessionCtl_Delegates.swift +++ b/Source/Modules/SessionCtl_Delegates.swift @@ -79,9 +79,7 @@ extension SessionCtl: CtlCandidateDelegate { && !clientBundleIdentifier.contains("com.raycast.macos") } - public var showReverseLookupResult: Bool { - !isVerticalTyping && PrefMgr.shared.showReverseLookupInCandidateUI - } + public var showReverseLookupResult: Bool { PrefMgr.shared.showReverseLookupInCandidateUI } @discardableResult public func reverseLookup(for value: String) -> [String] { let blankResult: [String] = [] diff --git a/Source/Modules/SessionCtl_HandleDisplay.swift b/Source/Modules/SessionCtl_HandleDisplay.swift index ed457bc0..dd5cb9a7 100644 --- a/Source/Modules/SessionCtl_HandleDisplay.swift +++ b/Source/Modules/SessionCtl_HandleDisplay.swift @@ -91,7 +91,8 @@ public extension SessionCtl { PrefMgr.shared.useIMKCandidateWindow ? CtlCandidateIMK(candidateLayout) : CtlCandidateTDK(candidateLayout) if let candidateTDK = candidateUI as? CtlCandidateTDK { - candidateTDK.maxLinesPerPage = isVerticalTyping ? 1 : 4 + let singleLine = isVerticalTyping || PrefMgr.shared.candidateWindowShowOnlyOneLine + candidateTDK.maxLinesPerPage = singleLine ? 1 : 4 } } else { candidateUI = CtlCandidateTDK(candidateLayout) @@ -101,14 +102,16 @@ public extension SessionCtl { name: PrefMgr.shared.candidateTextFontName, size: PrefMgr.shared.candidateListTextSize ) + let singleColumn = isVerticalTyping || PrefMgr.shared.candidateWindowShowOnlyOneLine + if PrefMgr.shared.cassetteEnabled { candidateUI?.tooltip = - isVerticalTyping ? "📼" : "📼 " + NSLocalizedString("CIN Cassette Mode", comment: "") + singleColumn ? "📼" : "📼 " + NSLocalizedString("CIN Cassette Mode", comment: "") } if state.type == .ofAssociates { candidateUI?.tooltip = - isVerticalTyping ? "⇧" : NSLocalizedString("Hold ⇧ to choose associates.", comment: "") + singleColumn ? "⇧" : NSLocalizedString("Hold ⇧ to choose associates.", comment: "") } candidateUI?.useLangIdentifier = PrefMgr.shared.legacyCandidateViewTypesettingMethodEnabled