From ccd9b391e4cd0d850ae445bff44dd760c3e9aeaf Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Thu, 15 Feb 2024 13:25:54 +0800 Subject: [PATCH] UserDef // +showCodePointInCandidateUI. --- .../Sources/MainAssembly/PrefMgr_Core.swift | 3 +++ .../SettingsCocoa/VwrSettingsPaneCocoaCandidates.swift | 1 + .../Settings/SettingsUI/VwrSettingsPaneCandidates.swift | 4 ++++ .../Sources/Shared/Protocols/PrefMgrProtocol.swift | 1 + .../vChewing_Shared/Sources/Shared/UserDef/UserDef.swift | 5 +++++ Source/Resources/en.lproj/Localizable.strings | 1 + Source/Resources/ja.lproj/Localizable.strings | 1 + Source/Resources/zh-Hans.lproj/Localizable.strings | 1 + Source/Resources/zh-Hant.lproj/Localizable.strings | 1 + 9 files changed, 18 insertions(+) diff --git a/Packages/vChewing_MainAssembly/Sources/MainAssembly/PrefMgr_Core.swift b/Packages/vChewing_MainAssembly/Sources/MainAssembly/PrefMgr_Core.swift index 92006337..295d6c46 100644 --- a/Packages/vChewing_MainAssembly/Sources/MainAssembly/PrefMgr_Core.swift +++ b/Packages/vChewing_MainAssembly/Sources/MainAssembly/PrefMgr_Core.swift @@ -196,6 +196,9 @@ import SwiftExtension @AppProperty(key: UserDef.kShowReverseLookupInCandidateUI.rawValue, defaultValue: true) public dynamic var showReverseLookupInCandidateUI: Bool + @AppProperty(key: UserDef.kShowCodePointInCandidateUI.rawValue, defaultValue: true) + public dynamic var showCodePointInCandidateUI: Bool + @AppProperty(key: UserDef.kAutoCompositeWithLongestPossibleCassetteKey.rawValue, defaultValue: true) public dynamic var autoCompositeWithLongestPossibleCassetteKey: Bool diff --git a/Packages/vChewing_MainAssembly/Sources/MainAssembly/Settings/SettingsCocoa/VwrSettingsPaneCocoaCandidates.swift b/Packages/vChewing_MainAssembly/Sources/MainAssembly/Settings/SettingsCocoa/VwrSettingsPaneCocoaCandidates.swift index bc7cc835..4bac5b01 100644 --- a/Packages/vChewing_MainAssembly/Sources/MainAssembly/Settings/SettingsCocoa/VwrSettingsPaneCocoaCandidates.swift +++ b/Packages/vChewing_MainAssembly/Sources/MainAssembly/Settings/SettingsCocoa/VwrSettingsPaneCocoaCandidates.swift @@ -64,6 +64,7 @@ public extension SettingsPanesCocoa { } NSTabView.TabPage(title: "C") { NSStackView.buildSection(width: innerContentWidth) { + UserDef.kShowCodePointInCandidateUI.render(fixWidth: innerContentWidth) UserDef.kShowReverseLookupInCandidateUI.render(fixWidth: innerContentWidth) UserDef.kUseFixedCandidateOrderOnSelection.render(fixWidth: innerContentWidth) UserDef.kConsolidateContextOnCandidateSelection.render(fixWidth: innerContentWidth) diff --git a/Packages/vChewing_MainAssembly/Sources/MainAssembly/Settings/SettingsUI/VwrSettingsPaneCandidates.swift b/Packages/vChewing_MainAssembly/Sources/MainAssembly/Settings/SettingsUI/VwrSettingsPaneCandidates.swift index c79bcc2d..f6bbf6d5 100644 --- a/Packages/vChewing_MainAssembly/Sources/MainAssembly/Settings/SettingsUI/VwrSettingsPaneCandidates.swift +++ b/Packages/vChewing_MainAssembly/Sources/MainAssembly/Settings/SettingsUI/VwrSettingsPaneCandidates.swift @@ -32,6 +32,9 @@ public struct VwrSettingsPaneCandidates: View { @AppStorage(wrappedValue: true, UserDef.kShowReverseLookupInCandidateUI.rawValue) private var showReverseLookupInCandidateUI: Bool + @AppStorage(wrappedValue: true, UserDef.kShowCodePointInCandidateUI.rawValue) + private var showCodePointInCandidateUI: Bool + @AppStorage(wrappedValue: false, UserDef.kUseRearCursorMode.rawValue) private var useRearCursorMode: Bool @@ -97,6 +100,7 @@ public struct VwrSettingsPaneCandidates: View { // MARK: (header: Text("Misc Settings:")) Section { + UserDef.kShowCodePointInCandidateUI.bind($showCodePointInCandidateUI).render() UserDef.kShowReverseLookupInCandidateUI.bind($showReverseLookupInCandidateUI).render() UserDef.kUseFixedCandidateOrderOnSelection.bind($useFixedCandidateOrderOnSelection).render() UserDef.kConsolidateContextOnCandidateSelection.bind($consolidateContextOnCandidateSelection).render() diff --git a/Packages/vChewing_Shared/Sources/Shared/Protocols/PrefMgrProtocol.swift b/Packages/vChewing_Shared/Sources/Shared/Protocols/PrefMgrProtocol.swift index 7bb7b440..61a0c069 100644 --- a/Packages/vChewing_Shared/Sources/Shared/Protocols/PrefMgrProtocol.swift +++ b/Packages/vChewing_Shared/Sources/Shared/Protocols/PrefMgrProtocol.swift @@ -64,6 +64,7 @@ public protocol PrefMgrProtocol { var showTranslatedStrokesInCompositionBuffer: Bool { get set } var forceCassetteChineseConversion: Int { get set } var showReverseLookupInCandidateUI: Bool { get set } + var showCodePointInCandidateUI: Bool { get set } var autoCompositeWithLongestPossibleCassetteKey: Bool { get set } var shareAlphanumericalModeStatusAcrossClients: Bool { get set } var phraseEditorAutoReloadExternalModifications: Bool { get set } diff --git a/Packages/vChewing_Shared/Sources/Shared/UserDef/UserDef.swift b/Packages/vChewing_Shared/Sources/Shared/UserDef/UserDef.swift index 1b264899..22f01aa1 100644 --- a/Packages/vChewing_Shared/Sources/Shared/UserDef/UserDef.swift +++ b/Packages/vChewing_Shared/Sources/Shared/UserDef/UserDef.swift @@ -97,6 +97,7 @@ public enum UserDef: String, CaseIterable, Identifiable { case kShowTranslatedStrokesInCompositionBuffer = "ShowTranslatedStrokesInCompositionBuffer" case kForceCassetteChineseConversion = "ForceCassetteChineseConversion" case kShowReverseLookupInCandidateUI = "ShowReverseLookupInCandidateUI" + case kShowCodePointInCandidateUI = "ShowCodePointInCandidateUI" case kAutoCompositeWithLongestPossibleCassetteKey = "AutoCompositeWithLongestPossibleCassetteKey" case kShareAlphanumericalModeStatusAcrossClients = "ShareAlphanumericalModeStatusAcrossClients" case kPhraseEditorAutoReloadExternalModifications = "PhraseEditorAutoReloadExternalModifications" @@ -219,6 +220,7 @@ public extension UserDef { case .kShowTranslatedStrokesInCompositionBuffer: return .bool case .kForceCassetteChineseConversion: return .integer case .kShowReverseLookupInCandidateUI: return .bool + case .kShowCodePointInCandidateUI: return .bool case .kAutoCompositeWithLongestPossibleCassetteKey: return .bool case .kShareAlphanumericalModeStatusAcrossClients: return .bool case .kPhraseEditorAutoReloadExternalModifications: return .bool @@ -527,6 +529,9 @@ public extension UserDef { userDef: self, shortTitle: "Show available reverse-lookup results in candidate window", description: "The lookup results are supplied by the CIN cassette module." ) + case .kShowCodePointInCandidateUI: return .init( + userDef: self, shortTitle: "i18n:UserDef.kShowCodePointInCandidateUI.shortTitle" + ) case .kAutoCompositeWithLongestPossibleCassetteKey: return .init( userDef: self, shortTitle: "Auto-composite when the longest possible key is formed" ) diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index 7ecc6d0f..bb99e82f 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -225,6 +225,7 @@ "i18n:userdef.kRespectClientAccentColor.shortTitle" = "Respect accent colors of the client app and the system"; "i18n:UserDef.kShiftEisuToggleOffTogetherWithCapsLock.description" = "This does: 1) On macOS 12 and later, if the Caps Lock gets turned off, then the internal switch for Shift-key / JIS-Eisu-key Alphanumerical Mode Toggle will also be switched off. 2) If you have turned off the same switch by JIS-Eisu key, then the Caps Lock gets turned off together. Note: vChewing has no way to recognize single hits of Shift key when Caps Lock is on."; "i18n:UserDef.kShiftEisuToggleOffTogetherWithCapsLock.shortTitle" = "Sync the off state between Caps Lock and Shift / Eisu Alphanumerical Toggle"; +"i18n:UserDef.kShowCodePointInCandidateUI.shortTitle" = "Show Unicode codepoint metadata in candidate window"; "i18n:UserDef.kUseJKtoMoveCompositorCursorInCandidateState.description" = "⚠︎ This will automatically prevent J and K from being used as candidate keys. Also, this won't work with ‘%quick’ candidates in cassette mode."; "i18n:UserDef.kUseJKtoMoveCompositorCursorInCandidateState.shortTitle" = "Use J / K to Move Buffer Cursor While Choosing Candidates"; "IBM" = "IBM"; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index e31df6c7..13b298c5 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -225,6 +225,7 @@ "i18n:userdef.kRespectClientAccentColor.shortTitle" = "客体アプリ・システムのアクセントカラーに準ず"; "i18n:UserDef.kShiftEisuToggleOffTogetherWithCapsLock.description" = "このチェックを入れると:イ)[macOS 12 以降] CapsLockがオフした時に、「Shiftキー・JIS英数キー」の共有していた内部のスイッチもオフにする;ロ)「JIS英数キー」でそのキーに応ずる英数モードがオフした時に、CapsLockもオフにする。尚、CapsLockがオンの時に、「Shiftキーだけを打った」行為は検知できません。"; "i18n:UserDef.kShiftEisuToggleOffTogetherWithCapsLock.shortTitle" = "「Shiftキー・JIS英数キー」による英数モードのオフ状態をCapsLockのオフ状態と同期する"; +"i18n:UserDef.kShowCodePointInCandidateUI.shortTitle" = "候補陳列ウィンドウで Unicode のコードポイント情報を示す"; "i18n:UserDef.kUseJKtoMoveCompositorCursorInCandidateState.description" = "⚠︎ これで「J / K」キーは言選り用キー陣列から自動的に外されます。尚、この機能はカセットモードの「%quick」による早速候補入力状態では利用できません。"; "i18n:UserDef.kUseJKtoMoveCompositorCursorInCandidateState.shortTitle" = "候補陳列が見えるとき、「J / K」キーで入力緩衝列のカーソルを移す"; "IBM" = "IBM 配列"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index e544971c..9bd49cb4 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -225,6 +225,7 @@ "i18n:userdef.kRespectClientAccentColor.shortTitle" = "遵循客体应用或系统全局的强调色偏好设定"; "i18n:UserDef.kShiftEisuToggleOffTogetherWithCapsLock.description" = "勾选该选项后:1) [至少 macOS 12 起] Caps Lock 在关掉的时候,会连带关掉由 Shift 键 / JIS 英数键负责控制的英数模式;2) 在借由 JIS 英数键关掉其控制的英数模式的时候,也会关掉 Caps Lock。注:威注音无法在 Caps Lock 亮灯的时候感知 Shift 键的单独敲击事件。"; "i18n:UserDef.kShiftEisuToggleOffTogetherWithCapsLock.shortTitle" = "使「Shift 键 / JIS 英数键」英数模式的关闭状态与 Caps Lock 的关闭状态保持彼此同步"; +"i18n:UserDef.kShowCodePointInCandidateUI.shortTitle" = "在选字窗内显示当前候选字的统一码码位"; "i18n:UserDef.kUseJKtoMoveCompositorCursorInCandidateState.description" = "⚠︎ 这将自动禁止 J / K 键用作选字键。另外,该功能在磁带模式的“%quick”快速选字状态下无效。"; "i18n:UserDef.kUseJKtoMoveCompositorCursorInCandidateState.shortTitle" = "在选字窗显示时允许以 J / K 键移动组字区游标"; "IBM" = "IBM 排列"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index 67cd7724..aafedca3 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -225,6 +225,7 @@ "i18n:userdef.kRespectClientAccentColor.shortTitle" = "遵循客體應用或系統全局的強調色偏好設定"; "i18n:UserDef.kShiftEisuToggleOffTogetherWithCapsLock.description" = "勾選該選項後:1) [至少 macOS 12 起] Caps Lock 在關掉的時候,會連帶關掉由 Shift 鍵 / JIS 英數鍵負責控制的英數模式;2) 在藉由 JIS 英數鍵關掉其控制的英數模式的時候,也會關掉 Caps Lock。註:威注音無法在 Caps Lock 亮燈的時候感知 Shift 鍵的單獨敲擊事件。"; "i18n:UserDef.kShiftEisuToggleOffTogetherWithCapsLock.shortTitle" = "使「Shift 鍵 / JIS 英数鍵」英數模式的關閉狀態與 Caps Lock 的關閉狀態保持彼此同步"; +"i18n:UserDef.kShowCodePointInCandidateUI.shortTitle" = "在選字窗內顯示當前候選字的統一碼碼位"; "i18n:UserDef.kUseJKtoMoveCompositorCursorInCandidateState.description" = "⚠︎ 這將自動禁止 J / K 鍵用作選字鍵。另外,該功能在磁帶模式的「%quick」快速選字狀態下無效。"; "i18n:UserDef.kUseJKtoMoveCompositorCursorInCandidateState.shortTitle" = "在選字窗顯示時允許以 J / K 鍵移動組字區游標"; "IBM" = "IBM 排列";