From 6f579fafd89a9e4550673858ad7f0f48d1509388 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Fri, 25 Nov 2022 12:09:22 +0800 Subject: [PATCH] SessionCtl // Add isCandidateState(). --- .../Sources/Shared/Protocols/CtlCandidateProtocol.swift | 1 + Source/Modules/SessionCtl_Delegates.swift | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Packages/vChewing_Shared/Sources/Shared/Protocols/CtlCandidateProtocol.swift b/Packages/vChewing_Shared/Sources/Shared/Protocols/CtlCandidateProtocol.swift index 5e673391..ba45bd4d 100644 --- a/Packages/vChewing_Shared/Sources/Shared/Protocols/CtlCandidateProtocol.swift +++ b/Packages/vChewing_Shared/Sources/Shared/Protocols/CtlCandidateProtocol.swift @@ -15,6 +15,7 @@ public protocol CtlCandidateDelegate { @discardableResult func reverseLookup(for value: String) -> [String] var selectionKeys: String { get } var isVerticalTyping: Bool { get } + var isCandidateState: Bool { get } var showReverseLookupResult: Bool { get } } diff --git a/Source/Modules/SessionCtl_Delegates.swift b/Source/Modules/SessionCtl_Delegates.swift index a538c0c8..00ab6081 100644 --- a/Source/Modules/SessionCtl_Delegates.swift +++ b/Source/Modules/SessionCtl_Delegates.swift @@ -56,6 +56,8 @@ extension SessionCtl: InputHandlerDelegate { // MARK: - Candidate Controller Delegate extension SessionCtl: CtlCandidateDelegate { + public var isCandidateState: Bool { state.isCandidateContainer } + public var showReverseLookupResult: Bool { !isVerticalTyping && PrefMgr.shared.showReverseLookupInCandidateUI }