From dd964b3c40409d9ce145feb9a7790446a097131d Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 27 Nov 2022 20:23:21 +0800 Subject: [PATCH] SessionCtl // +isCandidateContextMenuEnabled(). --- .../Sources/Shared/Protocols/CtlCandidateProtocol.swift | 1 + Source/Modules/SessionCtl_Delegates.swift | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Packages/vChewing_Shared/Sources/Shared/Protocols/CtlCandidateProtocol.swift b/Packages/vChewing_Shared/Sources/Shared/Protocols/CtlCandidateProtocol.swift index ba45bd4d..6c6500a0 100644 --- a/Packages/vChewing_Shared/Sources/Shared/Protocols/CtlCandidateProtocol.swift +++ b/Packages/vChewing_Shared/Sources/Shared/Protocols/CtlCandidateProtocol.swift @@ -16,6 +16,7 @@ public protocol CtlCandidateDelegate { var selectionKeys: String { get } var isVerticalTyping: Bool { get } var isCandidateState: Bool { get } + var isCandidateContextMenuEnabled: Bool { get } var showReverseLookupResult: Bool { get } } diff --git a/Source/Modules/SessionCtl_Delegates.swift b/Source/Modules/SessionCtl_Delegates.swift index 8c034071..1a3287a2 100644 --- a/Source/Modules/SessionCtl_Delegates.swift +++ b/Source/Modules/SessionCtl_Delegates.swift @@ -57,7 +57,7 @@ extension SessionCtl: InputHandlerDelegate { extension SessionCtl: CtlCandidateDelegate { public var isCandidateState: Bool { state.isCandidateContainer } - + public var isCandidateContextMenuEnabled: Bool { state.type == .ofCandidates } public var showReverseLookupResult: Bool { !isVerticalTyping && PrefMgr.shared.showReverseLookupInCandidateUI }