From 1fbf7f0c728a2057665725343e3890bff2631db1 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 14 Aug 2022 10:26:28 +0800 Subject: [PATCH] ctlIME // +isAssociatedPhrasesMode for ctlCandidateDelegate. --- Source/Modules/ControllerModules/ctlInputMethod_Delegates.swift | 2 ++ Source/Modules/UIModules/CandidateUI/ctlCandidate.swift | 1 + 2 files changed, 3 insertions(+) diff --git a/Source/Modules/ControllerModules/ctlInputMethod_Delegates.swift b/Source/Modules/ControllerModules/ctlInputMethod_Delegates.swift index 57993eb1..c8c8b00f 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_Delegates.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_Delegates.swift @@ -50,6 +50,8 @@ extension ctlInputMethod: KeyHandlerDelegate { // MARK: - Candidate Controller Delegate extension ctlInputMethod: ctlCandidateDelegate { + var isAssociatedPhrasesMode: Bool { state is InputState.AssociatedPhrases } + func handleDelegateEvent(_ event: NSEvent!) -> Bool { // 用 Shift 開關半形英數模式,僅對 macOS 10.15 及之後的 macOS 有效。 if #available(macOS 10.15, *) { diff --git a/Source/Modules/UIModules/CandidateUI/ctlCandidate.swift b/Source/Modules/UIModules/CandidateUI/ctlCandidate.swift index 6d6cb12a..a4aea23a 100644 --- a/Source/Modules/UIModules/CandidateUI/ctlCandidate.swift +++ b/Source/Modules/UIModules/CandidateUI/ctlCandidate.swift @@ -27,6 +27,7 @@ public class CandidateKeyLabel: NSObject { } public protocol ctlCandidateDelegate: AnyObject { + var isAssociatedPhrasesMode: Bool { get } func handleDelegateEvent(_ event: NSEvent!) -> Bool func candidateCountForController(_ controller: ctlCandidateProtocol) -> Int func candidatesForController(_ controller: ctlCandidateProtocol) -> [(String, String)]