From 6fc27788ed3481f25014854f9866577d349e4fdd Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 21 Aug 2022 23:36:46 +0800 Subject: [PATCH 01/12] ctlIME // Only handle composition if client() exists. --- Source/Modules/ControllerModules/ctlInputMethod_Common.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Modules/ControllerModules/ctlInputMethod_Common.swift b/Source/Modules/ControllerModules/ctlInputMethod_Common.swift index 6aafa997..e11b958d 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_Common.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_Common.swift @@ -39,6 +39,9 @@ extension ctlInputMethod { } } + /// 沒有文字輸入客體的話,就不要再往下處理了。 + guard client() != nil else { return false } + /// 這裡仍舊需要判斷 flags。之前使輸入法狀態卡住無法敲漢字的問題已在 KeyHandler 內修復。 /// 這裡不判斷 flags 的話,用方向鍵前後定位光標之後,再次試圖觸發組字區時、反而會在首次按鍵時失敗。 /// 同時注意:必須在 event.type == .flagsChanged 結尾插入 return false, From ecd2fe7403be87b5d4d5cf7eb64259f76ff1fb58 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 21 Aug 2022 23:20:59 +0800 Subject: [PATCH 02/12] PrefUI // Only enable .langIdentifier for macOS 12 and later. --- Source/Modules/UIModules/PrefUI/suiPrefPaneDevZone.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Modules/UIModules/PrefUI/suiPrefPaneDevZone.swift b/Source/Modules/UIModules/PrefUI/suiPrefPaneDevZone.swift index 266c2e4d..23cbb283 100644 --- a/Source/Modules/UIModules/PrefUI/suiPrefPaneDevZone.swift +++ b/Source/Modules/UIModules/PrefUI/suiPrefPaneDevZone.swift @@ -33,6 +33,13 @@ struct suiPrefPaneDevZone: View { } }() + var isMontereyOrAbove: Bool = { + if #available(macOS 12.0, *) { + return true + } + return false + }() + var body: some View { ScrollView { Preferences.Container(contentWidth: contentWidth) { @@ -77,6 +84,7 @@ struct suiPrefPaneDevZone: View { ) ) .preferenceDescription().fixedSize(horizontal: false, vertical: true) + .disabled(!isMontereyOrAbove) Toggle( LocalizedStringKey("Use Shift Key Accommodation in all cases"), isOn: $selShouldAlwaysUseShiftKeyAccommodation.onChange { From 7a5c3a6926fb41af03bb94a9cbd867eb38164a73 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 21 Aug 2022 22:15:40 +0800 Subject: [PATCH 03/12] IMKCandidates // Add the ability of tweaking font sizes. --- Source/Headers/vChewing-Bridging-Header.h | 10 ++++++++++ .../ControllerModules/ctlInputMethod_Core.swift | 2 +- .../ctlInputMethod_HandleDisplay.swift | 4 +++- .../UIModules/CandidateUI/ctlCandidateIMK.swift | 14 ++++++++++++-- vChewing.xcodeproj/project.pbxproj | 16 +++++++++++++++- 5 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 Source/Headers/vChewing-Bridging-Header.h diff --git a/Source/Headers/vChewing-Bridging-Header.h b/Source/Headers/vChewing-Bridging-Header.h new file mode 100644 index 00000000..e25b8a8e --- /dev/null +++ b/Source/Headers/vChewing-Bridging-Header.h @@ -0,0 +1,10 @@ +#import + +@interface IMKCandidates(vChewing) {} + +- (unsigned long long)windowLevel; +- (void)setWindowLevel:(unsigned long long)level; +- (BOOL)handleKeyboardEvent:(NSEvent *)event; +- (void)setFontSize:(double)fontSize; + +@end diff --git a/Source/Modules/ControllerModules/ctlInputMethod_Core.swift b/Source/Modules/ControllerModules/ctlInputMethod_Core.swift index 204cba63..d9a9cb70 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_Core.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_Core.swift @@ -252,7 +252,7 @@ class ctlInputMethod: IMKInputController { isARepeat: event.isARepeat, keyCode: event.keyCode ) - ctlCandidateCurrent.perform(Selector(("handleKeyboardEvent:")), with: newEvent) + ctlCandidateCurrent.handleKeyboardEvent(newEvent) } ctlCandidateCurrent.interpretKeyEvents([event]) diff --git a/Source/Modules/ControllerModules/ctlInputMethod_HandleDisplay.swift b/Source/Modules/ControllerModules/ctlInputMethod_HandleDisplay.swift index 248e60c5..7ab40ee9 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_HandleDisplay.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_HandleDisplay.swift @@ -110,7 +110,9 @@ extension ctlInputMethod { if let ctlCandidateCurrent = ctlInputMethod.ctlCandidateCurrent as? ctlCandidateIMK, mgrPrefs.adjustIMKCandidateWindowLevel { - ctlCandidateCurrent.perform(Selector(("setWindowLevel:")), with: client.windowLevel() + 1000) + while ctlCandidateCurrent.windowLevel() <= client.windowLevel() { + ctlCandidateCurrent.setWindowLevel(UInt64(max(0, client.windowLevel() + 1000))) + } } ctlInputMethod.ctlCandidateCurrent.visible = true diff --git a/Source/Modules/UIModules/CandidateUI/ctlCandidateIMK.swift b/Source/Modules/UIModules/CandidateUI/ctlCandidateIMK.swift index ae9a8ef6..253060d9 100644 --- a/Source/Modules/UIModules/CandidateUI/ctlCandidateIMK.swift +++ b/Source/Modules/UIModules/CandidateUI/ctlCandidateIMK.swift @@ -50,7 +50,17 @@ public class ctlCandidateIMK: IMKCandidates, ctlCandidateProtocol { public var keyLabelFont: NSFont = NSFont.monospacedDigitSystemFont( ofSize: 14, weight: .medium ) - public var candidateFont: NSFont = NSFont.systemFont(ofSize: 18) + + public var candidateFont: NSFont = NSFont.systemFont(ofSize: 18) { + didSet { + setFontSize(candidateFont.pointSize) + var attributes = attributes() + // FB11300759: Set "NSAttributedString.Key.font" doesn't work. + attributes?[NSAttributedString.Key.font] = candidateFont + setAttributes(attributes) + } + } + public var tooltip: String = "" var keyCount = 0 @@ -301,7 +311,7 @@ public class ctlCandidateIMK: IMKCandidates, ctlCandidateProtocol { return } } else { - perform(Selector(("handleKeyboardEvent:")), with: newEvent) + handleKeyboardEvent(newEvent) return } } diff --git a/vChewing.xcodeproj/project.pbxproj b/vChewing.xcodeproj/project.pbxproj index 96a01632..5e25beef 100644 --- a/vChewing.xcodeproj/project.pbxproj +++ b/vChewing.xcodeproj/project.pbxproj @@ -332,6 +332,7 @@ 5BEDB71E283B4AEA0078EB25 /* data-symbols.plist */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; name = "data-symbols.plist"; path = "Data/data-symbols.plist"; sourceTree = ""; }; 5BEDB71F283B4AEA0078EB25 /* data-zhuyinwen.plist */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; name = "data-zhuyinwen.plist"; path = "Data/data-zhuyinwen.plist"; sourceTree = ""; }; 5BEDB720283B4AEA0078EB25 /* data-cht.plist */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; name = "data-cht.plist"; path = "Data/data-cht.plist"; sourceTree = ""; }; + 5BF255CD28B2694E003ECB60 /* vChewing-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "vChewing-Bridging-Header.h"; sourceTree = ""; }; 5BF9DA2228840E6200DBD48E /* template-usersymbolphrases.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; lineEnding = 0; path = "template-usersymbolphrases.txt"; sourceTree = ""; usesTabs = 0; }; 5BF9DA2328840E6200DBD48E /* template-exclusions.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; lineEnding = 0; path = "template-exclusions.txt"; sourceTree = ""; usesTabs = 0; }; 5BF9DA2428840E6200DBD48E /* template-associatedPhrases-chs.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; lineEnding = 0; name = "template-associatedPhrases-chs.txt"; path = "../Data/components/chs/template-associatedPhrases-chs.txt"; sourceTree = ""; usesTabs = 0; }; @@ -760,6 +761,14 @@ path = KeyboardExtension; sourceTree = ""; }; + 5BF255CC28B2690B003ECB60 /* Headers */ = { + isa = PBXGroup; + children = ( + 5BF255CD28B2694E003ECB60 /* vChewing-Bridging-Header.h */, + ); + path = Headers; + sourceTree = ""; + }; 6A0D4E9215FC0CFA00ABF4B3 = { isa = PBXGroup; children = ( @@ -793,6 +802,7 @@ children = ( 5B62A35027AE7F6600A19448 /* Data */, 5B62A30127AE732800A19448 /* 3rdParty */, + 5BF255CC28B2690B003ECB60 /* Headers */, 6A0D4F1215FC0EB100ABF4B3 /* Modules */, 5B62A33027AE78E500A19448 /* Resources */, 5B62A33A27AE7C7500A19448 /* WindowControllers */, @@ -962,7 +972,7 @@ ProvisioningStyle = Automatic; }; 6A0D4EA115FC0D2D00ABF4B3 = { - LastSwiftMigration = 1240; + LastSwiftMigration = 1400; ProvisioningStyle = Automatic; }; 6ACA41CA15FC1D7500935EF6 = { @@ -1668,6 +1678,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; @@ -1711,6 +1722,7 @@ PRODUCT_BUNDLE_IDENTIFIER = org.atelierInmu.inputmethod.vChewing; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "Source/Headers/vChewing-Bridging-Header.h"; SWIFT_VERSION = 5.0; WRAPPER_EXTENSION = app; }; @@ -1723,6 +1735,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; @@ -1760,6 +1773,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OBJC_BRIDGING_HEADER = "Source/Headers/vChewing-Bridging-Header.h"; SWIFT_VERSION = 5.0; WRAPPER_EXTENSION = app; }; From 0dd1f834a04154eb63c0b8f3eec6f28464074463 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 21 Aug 2022 22:56:17 +0800 Subject: [PATCH 04/12] PrefUI & PrefWindow // Enable font size options for IMKCandidates. --- Source/Modules/UIModules/PrefUI/suiPrefPaneGeneral.swift | 1 - Source/WindowNIBs/Base.lproj/frmPrefWindow.xib | 5 ----- 2 files changed, 6 deletions(-) diff --git a/Source/Modules/UIModules/PrefUI/suiPrefPaneGeneral.swift b/Source/Modules/UIModules/PrefUI/suiPrefPaneGeneral.swift index 2f0b8ed7..50288c73 100644 --- a/Source/Modules/UIModules/PrefUI/suiPrefPaneGeneral.swift +++ b/Source/Modules/UIModules/PrefUI/suiPrefPaneGeneral.swift @@ -73,7 +73,6 @@ struct suiPrefPaneGeneral: View { } .labelsHidden() .frame(width: 120.0) - .disabled(mgrPrefs.useIMKCandidateWindow) Text(LocalizedStringKey("Choose candidate font size for better visual clarity.")) .preferenceDescription() } diff --git a/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib b/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib index 26169615..a9df2180 100644 --- a/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib +++ b/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib @@ -262,11 +262,6 @@ - - - NSNegateBoolean - - - + @@ -1096,54 +1096,21 @@ Features listed here may not work as expected. - - - - - - - - - - IMK Candidate Window has a bug (#FB11300759) that it is always shown below NSMenu and Spotlight window by default. By toggling this checkbox, vChewing will attempt to adjust its window level according to its current context. However, this accomodation itself has a bug (also filed in #FB11300759): as long as vChewing application restarted once, IMK Candidate Window will always be shown beneath all other windows in the current desktop. - - - - - - + - - - - - - + diff --git a/Source/WindowNIBs/en.lproj/frmPrefWindow.strings b/Source/WindowNIBs/en.lproj/frmPrefWindow.strings index 29e83c59..d8272f02 100644 --- a/Source/WindowNIBs/en.lproj/frmPrefWindow.strings +++ b/Source/WindowNIBs/en.lproj/frmPrefWindow.strings @@ -63,7 +63,6 @@ "jQC-12-UuK.ibShadowedObjectValues[1]" = "Item 2"; "jQC-12-UuK.ibShadowedObjectValues[2]" = "Item 3"; "lblDevZoneIMKCandidate.title" = "IMK candidate window is plagued with issues and incapabilities."; -"lblDevZoneIMKCandidateLevel.title" = "IMK Candidate Window has a bug (#FB11300759) that it is always shown below NSMenu and Spotlight window by default. By toggling this checkbox, vChewing will attempt to adjust its window level according to its current context. However, this accomodation itself has a bug (also filed in #FB11300759): as long as vChewing application restarted once, IMK Candidate Window will always be shown beneath all other windows in the current desktop."; "lblDevZoneTitleDescription.title" = "Warning: This page is for testing future features. \nFeatures listed here may not work as expected."; "lblUpperCaseLetterKeyBehavior.title" = "Choose the behavior of Shift+Letter key with letter inputs."; "Parser11.title" = "Secondary Pinyin with Numeral Intonation"; @@ -81,7 +80,6 @@ "s7u-Fm-dVg.title" = "Cycling Pages"; "shc-Nu-UsM.title" = "Show page buttons in candidate list"; "tglDevZoneIMKCandidate.title" = "Use IMK Candidate Window instead (will reboot the IME)"; -"tglDevZoneIMKCandidateLevel.title" = "Adjust the window level of IMK Candidate Window"; "TXr-FF-ehw.title" = "Traditional Chinese"; "ueU-Rz-a1C.title" = "Choose the behavior of (Shift+)Tab key in the candidate window."; "VdT-fw-7pQ.title" = "Debug Mode"; diff --git a/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings b/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings index 3e20aafd..be94e8ce 100644 --- a/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings +++ b/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings @@ -63,7 +63,6 @@ "jQC-12-UuK.ibShadowedObjectValues[1]" = "Item 2"; "jQC-12-UuK.ibShadowedObjectValues[2]" = "Item 3"; "lblDevZoneIMKCandidate.title" = "IMK 候補陳列ウィンドウで言選り用キーは現時点で調整不可、且つ他故障あり。"; -"lblDevZoneIMKCandidateLevel.title" = "IMK 候補陳列ウィンドウにはこういう欠陥がある (#FB11300759):何の特殊措置をしない限り、候補陳列ウィンドウは常に NSMenu と Spotlight に遮られている。これをチェックすれば、毎度候補陳列ウィンドウを呼ぶたびに、候補陳列ウィンドウの表示の優先順位を自動的に調整する。だが、この特殊措置こそが、完璧とは言えぬ(この欠陥も #FB11300759 に記されておる):一旦入力アプリ自身が再起動すると、このパソコンの再起動まで、IMK 候補陳列ウィンドウは所在のデスクトップの全てのウィンドウの後ろに隠されてしまうことになる。"; "lblDevZoneTitleDescription.title" = "警告:これからの新機能テストのために作ったページですから、\nここで陳列されている諸機能は予想通り動けるだと思わないでください。"; "lblUpperCaseLetterKeyBehavior.title" = "Shift+文字キーの行為をご指定ください。"; "Parser11.title" = "国音二式 (ローマ字+数字音調)"; @@ -81,7 +80,6 @@ "s7u-Fm-dVg.title" = "ページ"; "shc-Nu-UsM.title" = "ページボタンを表示"; "tglDevZoneIMKCandidate.title" = "IMK 候補陳列ウィンドウを起用(入力アプリは自動的に再起動)"; -"tglDevZoneIMKCandidateLevel.title" = "IMK 候補陳列ウィンドウの表示の優先順位を調整する"; "TXr-FF-ehw.title" = "繁体中国語"; "ueU-Rz-a1C.title" = "入力候補陳列での (Shift+)Tab キーの輪番切替対象をご指定ください。"; "VdT-fw-7pQ.title" = "欠陥辿着モード"; diff --git a/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings b/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings index 33796020..20306d50 100644 --- a/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings +++ b/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings @@ -63,7 +63,6 @@ "jQC-12-UuK.ibShadowedObjectValues[1]" = "Item 2"; "jQC-12-UuK.ibShadowedObjectValues[2]" = "Item 3"; "lblDevZoneIMKCandidate.title" = "IMK 选字窗目前暂时无法正常自订选字键,并具其它未知故障。"; -"lblDevZoneIMKCandidateLevel.title" = "IMK 选字窗有一处行为缺陷 (#FB11300759):在预设情况下,会始终被 NSMenu 和 Spotlight 挡住。启用该选项的话,威注音会试图根据当前状况自动调整该选字窗的显示优先级。然而,该保守治疗方案本身也有一个缺陷 (也备案于 #FB11300759):只要输入法本身有重新启动过,则 IMK 选字窗便会顽固地显示于当前桌面所有视窗的底部,直至重新开机为止。"; "lblDevZoneTitleDescription.title" = "警告:该页面仅作未来功能测试所用。\n在此列出的功能并非处于完全可用之状态。"; "lblUpperCaseLetterKeyBehavior.title" = "指定 Shift+字母键 的行为。"; "Parser11.title" = "国音二式+数字标调"; @@ -81,7 +80,6 @@ "s7u-Fm-dVg.title" = "轮替页面"; "shc-Nu-UsM.title" = "在选字窗内显示翻页按钮"; "tglDevZoneIMKCandidate.title" = "启用与 macOS 内建输入法相同的 IMK 选字窗(会自动重启输入法)"; -"tglDevZoneIMKCandidateLevel.title" = "调整 IMK 选字窗的显示优先级"; "TXr-FF-ehw.title" = "繁体中文"; "ueU-Rz-a1C.title" = "指定 (Shift+)Tab 热键在选字窗内的轮替操作对象。"; "VdT-fw-7pQ.title" = "侦错模式"; diff --git a/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings b/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings index 697a2004..717a2817 100644 --- a/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings +++ b/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings @@ -63,7 +63,6 @@ "jQC-12-UuK.ibShadowedObjectValues[1]" = "Item 2"; "jQC-12-UuK.ibShadowedObjectValues[2]" = "Item 3"; "lblDevZoneIMKCandidate.title" = "IMK 選字窗目前暫時無法正常自訂選字鍵,併具其它未知故障。"; -"lblDevZoneIMKCandidateLevel.title" = "IMK 選字窗有一處行為缺陷 (#FB11300759):在預設情況下,會始終被 NSMenu 和 Spotlight 擋住。啟用該選項的話,威注音會試圖根據當前狀況自動調整該選字窗的顯示優先級。然而,該保守治療方案本身也有一個缺陷 (也備案於 #FB11300759):只要輸入法本身有重新啟動過,則 IMK 選字窗便會頑固地顯示於當前桌面所有視窗的底部,直至重新開機為止。"; "lblDevZoneTitleDescription.title" = "警告:該頁面僅作未來功能測試所用。\n在此列出的功能並非處於完全可用之狀態。"; "lblUpperCaseLetterKeyBehavior.title" = "指定 Shift+字母鍵 的行為。"; "Parser11.title" = "國音二式+數字標調"; @@ -81,7 +80,6 @@ "s7u-Fm-dVg.title" = "輪替頁面"; "shc-Nu-UsM.title" = "在選字窗內顯示翻頁按鈕"; "tglDevZoneIMKCandidate.title" = "啟用與 macOS 內建輸入法相同的 IMK 選字窗(會自動重啟輸入法)"; -"tglDevZoneIMKCandidateLevel.title" = "調整 IMK 選字窗的顯示優先級"; "TXr-FF-ehw.title" = "繁體中文"; "ueU-Rz-a1C.title" = "指定 (Shift+)Tab 熱鍵在選字窗內的輪替操作對象。"; "VdT-fw-7pQ.title" = "偵錯模式"; From 018e07493e570956fa566e5233d7d9713eeceeb3 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 22 Aug 2022 09:28:17 +0800 Subject: [PATCH 10/12] Prefs // Update descriptions regarding IMKCandidates. --- Source/Modules/UIModules/PrefUI/suiPrefPaneDevZone.swift | 8 ++++++-- Source/Resources/Base.lproj/Localizable.strings | 2 +- Source/Resources/en.lproj/Localizable.strings | 2 +- Source/Resources/ja.lproj/Localizable.strings | 2 +- Source/Resources/zh-Hans.lproj/Localizable.strings | 2 +- Source/Resources/zh-Hant.lproj/Localizable.strings | 2 +- Source/WindowNIBs/Base.lproj/frmPrefWindow.xib | 3 ++- Source/WindowNIBs/en.lproj/frmPrefWindow.strings | 2 +- Source/WindowNIBs/ja.lproj/frmPrefWindow.strings | 2 +- Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings | 2 +- Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings | 2 +- 11 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Source/Modules/UIModules/PrefUI/suiPrefPaneDevZone.swift b/Source/Modules/UIModules/PrefUI/suiPrefPaneDevZone.swift index fecbb966..ef73f01b 100644 --- a/Source/Modules/UIModules/PrefUI/suiPrefPaneDevZone.swift +++ b/Source/Modules/UIModules/PrefUI/suiPrefPaneDevZone.swift @@ -56,8 +56,12 @@ struct suiPrefPaneDevZone: View { NSApplication.shared.terminate(nil) } ) - Text(LocalizedStringKey("IMK candidate window is plagued with issues and incapabilities.")) - .preferenceDescription().fixedSize(horizontal: false, vertical: true) + Text( + LocalizedStringKey( + "IMK candidate window relies on certain Apple private APIs which are force-exposed by using bridging headers. Its usability, at this moment, is only guaranteed from macOS 10.14 Mojave to macOS 13 Ventura. Further tests are required in the future in order to tell whether it is usable in newer macOS releases." + ) + ) + .preferenceDescription().fixedSize(horizontal: false, vertical: true) Toggle( LocalizedStringKey("Use .langIdentifier to handle UI fonts in candidate window"), isOn: $selHandleDefaultCandidateFontsByLangIdentifier.onChange { diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings index 0bb12d9c..7ed77e08 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -147,7 +147,7 @@ "Hsu" = "Hsu"; "Hualuo Pinyin with Numeral Intonation" = "Hualuo Pinyin with Numeral Intonation"; "IBM" = "IBM"; -"IMK candidate window is plagued with issues and incapabilities." = "IMK candidate window is plagued with issues and incapabilities."; +"IMK candidate window relies on certain Apple private APIs which are force-exposed by using bridging headers. Its usability, at this moment, is only guaranteed from macOS 10.14 Mojave to macOS 13 Ventura. Further tests are required in the future in order to tell whether it is usable in newer macOS releases." = "IMK candidate window relies on certain Apple private APIs which are force-exposed by using bridging headers. Its usability, at this moment, is only guaranteed from macOS 10.14 Mojave to macOS 13 Ventura. Further tests are required in the future in order to tell whether it is usable in newer macOS releases."; "in front of the phrase (like macOS built-in Zhuyin IME)" = "in front of the phrase (like macOS built-in Zhuyin IME)"; "Japanese" = "Japanese"; "Keyboard Shortcuts:" = "Keyboard Shortcuts:"; diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index 0bb12d9c..7ed77e08 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -147,7 +147,7 @@ "Hsu" = "Hsu"; "Hualuo Pinyin with Numeral Intonation" = "Hualuo Pinyin with Numeral Intonation"; "IBM" = "IBM"; -"IMK candidate window is plagued with issues and incapabilities." = "IMK candidate window is plagued with issues and incapabilities."; +"IMK candidate window relies on certain Apple private APIs which are force-exposed by using bridging headers. Its usability, at this moment, is only guaranteed from macOS 10.14 Mojave to macOS 13 Ventura. Further tests are required in the future in order to tell whether it is usable in newer macOS releases." = "IMK candidate window relies on certain Apple private APIs which are force-exposed by using bridging headers. Its usability, at this moment, is only guaranteed from macOS 10.14 Mojave to macOS 13 Ventura. Further tests are required in the future in order to tell whether it is usable in newer macOS releases."; "in front of the phrase (like macOS built-in Zhuyin IME)" = "in front of the phrase (like macOS built-in Zhuyin IME)"; "Japanese" = "Japanese"; "Keyboard Shortcuts:" = "Keyboard Shortcuts:"; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index 3aaca0f4..fcbb5c0f 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -147,7 +147,7 @@ "Hsu" = "許氏国音自然配列"; "Hualuo Pinyin with Numeral Intonation" = "中華ローマ弁音 (ローマ字+数字音調)"; "IBM" = "IBM 配列"; -"IMK candidate window is plagued with issues and incapabilities." = "IMK 候補陳列ウィンドウで言選り用キーは現時点で調整不可、且つ他故障あり。"; +"IMK candidate window relies on certain Apple private APIs which are force-exposed by using bridging headers. Its usability, at this moment, is only guaranteed from macOS 10.14 Mojave to macOS 13 Ventura. Further tests are required in the future in order to tell whether it is usable in newer macOS releases." = "IMK 候補陳列ウィンドウは、Apple の未公開のAPIを「bridging-header」という強引的な手段で引き出して利用した機能である。現時点で macOS 10.14 Mojave から macOS 13 Ventura まで利用可能であるが、その後の新しい macOS との互換性の話はまだ早い。"; "in front of the phrase (like macOS built-in Zhuyin IME)" = "単語の前で // macOS 内蔵注音入力のやり方"; "Japanese" = "和語"; "Keyboard Shortcuts:" = "ショートカット:"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index 63e76a4e..90352681 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -147,7 +147,7 @@ "Hsu" = "许氏国音自然排列"; "Hualuo Pinyin with Numeral Intonation" = "华罗拼音+数字标调"; "IBM" = "IBM 排列"; -"IMK candidate window is plagued with issues and incapabilities." = "IMK 选字窗目前暂时无法正常自订选字键,并具其它未知故障。"; +"IMK candidate window relies on certain Apple private APIs which are force-exposed by using bridging headers. Its usability, at this moment, is only guaranteed from macOS 10.14 Mojave to macOS 13 Ventura. Further tests are required in the future in order to tell whether it is usable in newer macOS releases." = "IMK 选字窗依赖于 Apple 的私有 API,而且是借由桥接档案头强制曝露的方法使用的。目前,该功能仅在 macOS 10.14 Mojave 至 macOS 13 Ventura 系统内有测试过可用性。至于在未来的 macOS 发行版当中是否可用,则需要另行测试、才能下结论。"; "in front of the phrase (like macOS built-in Zhuyin IME)" = "将游标置于词语前方 // macOS 内建注音风格"; "Japanese" = "和语"; "Keyboard Shortcuts:" = "键盘快捷键:"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index 6ce6ea53..e31e88b0 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -147,7 +147,7 @@ "Hsu" = "許氏國音自然排列"; "Hualuo Pinyin with Numeral Intonation" = "華羅拼音+數字標調"; "IBM" = "IBM 排列"; -"IMK candidate window is plagued with issues and incapabilities." = "IMK 選字窗目前暫時無法正常自訂選字鍵,併具其它未知故障。"; +"IMK candidate window relies on certain Apple private APIs which are force-exposed by using bridging headers. Its usability, at this moment, is only guaranteed from macOS 10.14 Mojave to macOS 13 Ventura. Further tests are required in the future in order to tell whether it is usable in newer macOS releases." = "IMK 選字窗依賴於 Apple 的私有 API,而且是藉由橋接檔案頭強制曝露的方法使用的。目前,該功能僅在 macOS 10.14 Mojave 至 macOS 13 Ventura 系統內有測試過可用性。至於在未來的 macOS 發行版當中是否可用,則需要另行測試、才能下結論。"; "in front of the phrase (like macOS built-in Zhuyin IME)" = "將游標置於詞語前方 // macOS 內建注音風格"; "Japanese" = "和語"; "Keyboard Shortcuts:" = "鍵盤快速鍵:"; diff --git a/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib b/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib index 078f3c8a..942aacf5 100644 --- a/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib +++ b/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib @@ -1090,8 +1090,9 @@ Features listed here may not work as expected. - + + IMK candidate window relies on certain Apple private APIs which are force-exposed by using bridging headers. Its usability, at this moment, is only guaranteed from macOS 10.14 Mojave to macOS 13 Ventura. Further tests are required in the future in order to tell whether it is usable in newer macOS releases. diff --git a/Source/WindowNIBs/en.lproj/frmPrefWindow.strings b/Source/WindowNIBs/en.lproj/frmPrefWindow.strings index d8272f02..2a4af058 100644 --- a/Source/WindowNIBs/en.lproj/frmPrefWindow.strings +++ b/Source/WindowNIBs/en.lproj/frmPrefWindow.strings @@ -62,7 +62,7 @@ "jQC-12-UuK.ibShadowedObjectValues[0]" = "Item 1"; "jQC-12-UuK.ibShadowedObjectValues[1]" = "Item 2"; "jQC-12-UuK.ibShadowedObjectValues[2]" = "Item 3"; -"lblDevZoneIMKCandidate.title" = "IMK candidate window is plagued with issues and incapabilities."; +"lblDevZoneIMKCandidate.title" = "IMK candidate window relies on certain Apple private APIs which are force-exposed by using bridging headers. Its usability, at this moment, is only guaranteed from macOS 10.14 Mojave to macOS 13 Ventura. Further tests are required in the future in order to tell whether it is usable in newer macOS releases."; "lblDevZoneTitleDescription.title" = "Warning: This page is for testing future features. \nFeatures listed here may not work as expected."; "lblUpperCaseLetterKeyBehavior.title" = "Choose the behavior of Shift+Letter key with letter inputs."; "Parser11.title" = "Secondary Pinyin with Numeral Intonation"; diff --git a/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings b/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings index be94e8ce..60a701f9 100644 --- a/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings +++ b/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings @@ -62,7 +62,7 @@ "jQC-12-UuK.ibShadowedObjectValues[0]" = "Item 1"; "jQC-12-UuK.ibShadowedObjectValues[1]" = "Item 2"; "jQC-12-UuK.ibShadowedObjectValues[2]" = "Item 3"; -"lblDevZoneIMKCandidate.title" = "IMK 候補陳列ウィンドウで言選り用キーは現時点で調整不可、且つ他故障あり。"; +"lblDevZoneIMKCandidate.title" = "IMK 候補陳列ウィンドウは、Apple の未公開のAPIを「bridging-header」という強引的な手段で引き出して利用した機能である。現時点で macOS 10.14 Mojave から macOS 13 Ventura まで利用可能であるが、その後の新しい macOS との互換性の話はまだ早い。"; "lblDevZoneTitleDescription.title" = "警告:これからの新機能テストのために作ったページですから、\nここで陳列されている諸機能は予想通り動けるだと思わないでください。"; "lblUpperCaseLetterKeyBehavior.title" = "Shift+文字キーの行為をご指定ください。"; "Parser11.title" = "国音二式 (ローマ字+数字音調)"; diff --git a/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings b/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings index 20306d50..8aa957bd 100644 --- a/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings +++ b/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings @@ -62,7 +62,7 @@ "jQC-12-UuK.ibShadowedObjectValues[0]" = "Item 1"; "jQC-12-UuK.ibShadowedObjectValues[1]" = "Item 2"; "jQC-12-UuK.ibShadowedObjectValues[2]" = "Item 3"; -"lblDevZoneIMKCandidate.title" = "IMK 选字窗目前暂时无法正常自订选字键,并具其它未知故障。"; +"lblDevZoneIMKCandidate.title" = "IMK 选字窗依赖于 Apple 的私有 API,而且是借由桥接档案头强制曝露的方法使用的。目前,该功能仅在 macOS 10.14 Mojave 至 macOS 13 Ventura 系统内有测试过可用性。至于在未来的 macOS 发行版当中是否可用,则需要另行测试、才能下结论。"; "lblDevZoneTitleDescription.title" = "警告:该页面仅作未来功能测试所用。\n在此列出的功能并非处于完全可用之状态。"; "lblUpperCaseLetterKeyBehavior.title" = "指定 Shift+字母键 的行为。"; "Parser11.title" = "国音二式+数字标调"; diff --git a/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings b/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings index 717a2817..a13c476b 100644 --- a/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings +++ b/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings @@ -62,7 +62,7 @@ "jQC-12-UuK.ibShadowedObjectValues[0]" = "Item 1"; "jQC-12-UuK.ibShadowedObjectValues[1]" = "Item 2"; "jQC-12-UuK.ibShadowedObjectValues[2]" = "Item 3"; -"lblDevZoneIMKCandidate.title" = "IMK 選字窗目前暫時無法正常自訂選字鍵,併具其它未知故障。"; +"lblDevZoneIMKCandidate.title" = "IMK 選字窗依賴於 Apple 的私有 API,而且是藉由橋接檔案頭強制曝露的方法使用的。目前,該功能僅在 macOS 10.14 Mojave 至 macOS 13 Ventura 系統內有測試過可用性。至於在未來的 macOS 發行版當中是否可用,則需要另行測試、才能下結論。"; "lblDevZoneTitleDescription.title" = "警告:該頁面僅作未來功能測試所用。\n在此列出的功能並非處於完全可用之狀態。"; "lblUpperCaseLetterKeyBehavior.title" = "指定 Shift+字母鍵 的行為。"; "Parser11.title" = "國音二式+數字標調"; From a2a9f7fbde73d427be1d926c4a91545e5bda51ea Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 22 Aug 2022 09:45:19 +0800 Subject: [PATCH 11/12] PrefUI & PrefWindow // Enable certain new font sizes. --- .../UIModules/PrefUI/suiPrefPaneGeneral.swift | 13 +++++-------- Source/WindowNIBs/Base.lproj/frmPrefWindow.xib | 3 +++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Modules/UIModules/PrefUI/suiPrefPaneGeneral.swift b/Source/Modules/UIModules/PrefUI/suiPrefPaneGeneral.swift index 50288c73..cdef3340 100644 --- a/Source/Modules/UIModules/PrefUI/suiPrefPaneGeneral.swift +++ b/Source/Modules/UIModules/PrefUI/suiPrefPaneGeneral.swift @@ -52,6 +52,8 @@ struct suiPrefPaneGeneral: View { } }() + let enabledFontSizes = [12, 14, 16, 17, 18, 20, 22, 24, 32, 64, 96] + var body: some View { ScrollView { Preferences.Container(contentWidth: contentWidth) { @@ -62,14 +64,9 @@ struct suiPrefPaneGeneral: View { mgrPrefs.candidateListTextSize = CGFloat(selCandidateUIFontSize) } ) { - Text("12").tag(12) - Text("14").tag(14) - Text("16").tag(16) - Text("18").tag(18) - Text("24").tag(24) - Text("32").tag(32) - Text("64").tag(64) - Text("96").tag(96) + ForEach(0...(enabledFontSizes.count - 1), id: \.self) { id in + Text(String(enabledFontSizes[id])).tag(enabledFontSizes[id]) + }.id(UUID()) } .labelsHidden() .frame(width: 120.0) diff --git a/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib b/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib index 942aacf5..1e711983 100644 --- a/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib +++ b/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib @@ -252,7 +252,10 @@ + + + From 205a8a7c076404454ea74b9036679fbbeec0936d Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 22 Aug 2022 10:23:05 +0800 Subject: [PATCH 12/12] Bump version to 2.0.0 SP2 Build 2002. --- Update-Info.plist | 2 +- vChewing.xcodeproj/project.pbxproj | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Update-Info.plist b/Update-Info.plist index 9e337514..4e31fb8b 100644 --- a/Update-Info.plist +++ b/Update-Info.plist @@ -5,7 +5,7 @@ CFBundleShortVersionString 2.0.0 CFBundleVersion - 2001 + 2002 UpdateInfoEndpoint https://gitee.com/vchewing/vChewing-macOS/raw/main/Update-Info.plist UpdateInfoSite diff --git a/vChewing.xcodeproj/project.pbxproj b/vChewing.xcodeproj/project.pbxproj index 5e25beef..99d74817 100644 --- a/vChewing.xcodeproj/project.pbxproj +++ b/vChewing.xcodeproj/project.pbxproj @@ -1431,7 +1431,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2001; + CURRENT_PROJECT_VERSION = 2002; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -1470,7 +1470,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2001; + CURRENT_PROJECT_VERSION = 2002; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -1507,7 +1507,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 2001; + CURRENT_PROJECT_VERSION = 2002; DEAD_CODE_STRIPPING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; @@ -1557,7 +1557,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 2001; + CURRENT_PROJECT_VERSION = 2002; DEAD_CODE_STRIPPING = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -1689,7 +1689,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 2001; + CURRENT_PROJECT_VERSION = 2002; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = ""; @@ -1746,7 +1746,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 2001; + CURRENT_PROJECT_VERSION = 2002; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = ""; @@ -1791,7 +1791,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 2001; + CURRENT_PROJECT_VERSION = 2002; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -1833,7 +1833,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 2001; + CURRENT_PROJECT_VERSION = 2002; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu99;