From baa0a9bd33ef16cc3250243ad7bf9c6da4cccfd6 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Wed, 3 Aug 2022 21:19:02 +0800 Subject: [PATCH] PrefUI // Layout optimization. --- .../Resources/Base.lproj/Localizable.strings | 1 - Source/Resources/en.lproj/Localizable.strings | 1 - Source/Resources/ja.lproj/Localizable.strings | 1 - .../zh-Hans.lproj/Localizable.strings | 1 - .../zh-Hant.lproj/Localizable.strings | 1 - Source/UI/PrefUI/suiPrefPaneExperience.swift | 26 +++++++++---------- 6 files changed, 12 insertions(+), 19 deletions(-) diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings index cee51779..e89e14a0 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -156,7 +156,6 @@ "Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "Show Hanyu-Pinyin in the inline composition buffer & tooltip"; "Show page buttons in candidate window" = "Show page buttons in candidate window"; "Simplified Chinese" = "Simplified Chinese"; -"Space & ESC Key:" = "Space & ESC Key:"; "Space to +cycle candidates, Shift+Space to +cycle pages" = "Space to +cycle candidates, Shift+Space to +cycle pages"; "Space to +cycle pages, Shift+Space to +cycle candidates" = "Space to +cycle pages, Shift+Space to +cycle candidates"; "Starlight" = "Starlight"; diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index cee51779..e89e14a0 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -156,7 +156,6 @@ "Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "Show Hanyu-Pinyin in the inline composition buffer & tooltip"; "Show page buttons in candidate window" = "Show page buttons in candidate window"; "Simplified Chinese" = "Simplified Chinese"; -"Space & ESC Key:" = "Space & ESC Key:"; "Space to +cycle candidates, Shift+Space to +cycle pages" = "Space to +cycle candidates, Shift+Space to +cycle pages"; "Space to +cycle pages, Shift+Space to +cycle candidates" = "Space to +cycle pages, Shift+Space to +cycle candidates"; "Starlight" = "Starlight"; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index 7aa9df53..d3dc1d4d 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -156,7 +156,6 @@ "Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "弁音合併入力(入力緩衝列とヒントで音読みを漢語弁音に)"; "Show page buttons in candidate window" = "入力候補陳列の側にページボタンを表示"; "Simplified Chinese" = "簡体中国語"; -"Space & ESC Key:" = "ESC と Space:"; "Space to +cycle candidates, Shift+Space to +cycle pages" = "Shift+Space で次のページ、Space で次の候補文字を"; "Space to +cycle pages, Shift+Space to +cycle candidates" = "Space で次のページ、Shift+Space で次の候補文字を"; "Starlight" = "星光配列"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index cc601500..24943ce8 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -157,7 +157,6 @@ "Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "拼音并击(组字区与工具提示内显示汉语拼音)"; "Show page buttons in candidate window" = "在选字窗内显示翻页按钮"; "Simplified Chinese" = "简体中文"; -"Space & ESC Key:" = "ESC 与空格键:"; "Space to +cycle candidates, Shift+Space to +cycle pages" = "Shift+空格键 换下一页,空格键 换选下一个后选字"; "Space to +cycle pages, Shift+Space to +cycle candidates" = "空格键 换下一页,Shift+空格键 换选下一个后选字"; "Starlight" = "星光排列"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index e3fdce9b..a5160c11 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -156,7 +156,6 @@ "Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "拼音並擊(組字區與工具提示內顯示漢語拼音)"; "Show page buttons in candidate window" = "在選字窗內顯示翻頁按鈕"; "Simplified Chinese" = "簡體中文"; -"Space & ESC Key:" = "ESC 與空格鍵:"; "Space to +cycle candidates, Shift+Space to +cycle pages" = "Shift+空格鍵 換下一頁,空格鍵 換選下一個後選字"; "Space to +cycle pages, Shift+Space to +cycle candidates" = "空格鍵 換下一頁,Shift+空格鍵 換選下一個後選字"; "Starlight" = "星光排列"; diff --git a/Source/UI/PrefUI/suiPrefPaneExperience.swift b/Source/UI/PrefUI/suiPrefPaneExperience.swift index 8c8e721a..b2eb09b4 100644 --- a/Source/UI/PrefUI/suiPrefPaneExperience.swift +++ b/Source/UI/PrefUI/suiPrefPaneExperience.swift @@ -50,7 +50,7 @@ struct suiPrefPaneExperience: View { var body: some View { Preferences.Container(contentWidth: contentWidth) { - Preferences.Section(bottomDivider: true, label: { Text(LocalizedStringKey("Selection Keys:")) }) { + Preferences.Section(label: { Text(LocalizedStringKey("Selection Keys:")) }) { ComboBox(items: mgrPrefs.suggestedCandidateKeys, text: $selSelectionKeys).frame(width: 180).onChange( of: selSelectionKeys ) { value in @@ -78,7 +78,7 @@ struct suiPrefPaneExperience: View { ) .preferenceDescription() } - Preferences.Section(bottomDivider: true, label: { Text(LocalizedStringKey("Cursor Selection:")) }) { + Preferences.Section(label: { Text(LocalizedStringKey("Cursor Selection:")) }) { Picker("", selection: $selCursorPosition) { Text(LocalizedStringKey("in front of the phrase (like macOS built-in Zhuyin IME)")).tag(0) Text(LocalizedStringKey("at the rear of the phrase (like Microsoft New Phonetic)")).tag(1) @@ -96,7 +96,7 @@ struct suiPrefPaneExperience: View { mgrPrefs.moveCursorAfterSelectingCandidate = value }.controlSize(.small) } - Preferences.Section(title: "(Shift+)Tab:", bottomDivider: true) { + Preferences.Section(title: "(Shift+)Tab:") { Picker("", selection: $selKeyBehaviorShiftTab) { Text(LocalizedStringKey("for cycling candidates")).tag(0) Text(LocalizedStringKey("for cycling pages")).tag(1) @@ -109,7 +109,7 @@ struct suiPrefPaneExperience: View { Text(LocalizedStringKey("Choose the behavior of (Shift+)Tab key in the candidate window.")) .preferenceDescription() } - Preferences.Section(bottomDivider: true, label: { Text(LocalizedStringKey("(Shift+)Space:")) }) { + Preferences.Section(label: { Text(LocalizedStringKey("(Shift+)Space:")) }) { Picker("", selection: $selKeyBehaviorShiftSpace) { Text(LocalizedStringKey("Space to +cycle candidates, Shift+Space to +cycle pages")).tag(0) Text(LocalizedStringKey("Space to +cycle pages, Shift+Space to +cycle candidates")).tag(1) @@ -121,7 +121,7 @@ struct suiPrefPaneExperience: View { Text(LocalizedStringKey("Choose the behavior of (Shift+)Space key with candidates.")) .preferenceDescription() } - Preferences.Section(bottomDivider: true, label: { Text(LocalizedStringKey("Space & ESC Key:")) }) { + Preferences.Section(label: { Text(LocalizedStringKey("Misc Settings:")) }) { Toggle( LocalizedStringKey("Enable Space key for calling candidate window"), isOn: $selKeyBehaviorSpaceForCallingCandidate @@ -134,21 +134,12 @@ struct suiPrefPaneExperience: View { ).onChange(of: selKeyBehaviorESCForClearingTheBuffer) { value in mgrPrefs.escToCleanInputBuffer = value } - } - Preferences.Section(label: { Text(LocalizedStringKey("Typing Style:")) }) { Toggle( LocalizedStringKey("Automatically correct reading combinations when typing"), isOn: $selAutoCorrectReadingCombination ).onChange(of: selAutoCorrectReadingCombination) { value in mgrPrefs.autoCorrectReadingCombination = value } - Toggle( - LocalizedStringKey("Emulating select-candidate-per-character mode"), isOn: $selEnableSCPCTypingMode - ).onChange(of: selEnableSCPCTypingMode) { value in - mgrPrefs.useSCPCTypingMode = value - } - Text(LocalizedStringKey("An accomodation for elder computer users.")) - .preferenceDescription() Toggle( LocalizedStringKey("Allow using Enter key to confirm associated candidate selection"), isOn: $selAlsoConfirmAssociatedCandidatesByEnter @@ -161,6 +152,13 @@ struct suiPrefPaneExperience: View { ).onChange(of: selKeepReadingUponCompositionError) { value in mgrPrefs.keepReadingUponCompositionError = value } + Toggle( + LocalizedStringKey("Emulating select-candidate-per-character mode"), isOn: $selEnableSCPCTypingMode + ).onChange(of: selEnableSCPCTypingMode) { value in + mgrPrefs.useSCPCTypingMode = value + } + Text(LocalizedStringKey("An accomodation for elder computer users.")) + .preferenceDescription() } } }