PrefUI // Add quick setup buttons for keyLayouts.

This commit is contained in:
ShikiSuen 2022-10-09 15:53:20 +08:00
parent ae776fb12d
commit 65f8bc2eff
7 changed files with 46 additions and 17 deletions

View File

@ -41,7 +41,7 @@ extension Tekkon {
var name: String {
switch self {
case .ofDachen:
return "Dachen"
return "Dachen Trad."
case .ofDachen26:
return "Dachen26"
case .ofETen:

View File

@ -94,6 +94,34 @@ struct suiPrefPaneKeyboard: View {
.preferenceDescription()
}
}
Preferences.Section(label: { Text(LocalizedStringKey("Quick Setup:")) }) {
HStack {
Button {
PrefMgr.shared.keyboardParser = 0
selKeyboardParser = PrefMgr.shared.keyboardParser
PrefMgr.shared.basicKeyboardLayout = "com.apple.keylayout.ZhuyinBopomofo"
selBasicKeyboardLayout = PrefMgr.shared.basicKeyboardLayout
} label: {
Text("↻ㄅ" + " " + NSLocalizedString("Dachen Trad.", comment: ""))
}
Button {
PrefMgr.shared.keyboardParser = 1
selKeyboardParser = PrefMgr.shared.keyboardParser
PrefMgr.shared.basicKeyboardLayout = "com.apple.keylayout.ZhuyinEten"
selBasicKeyboardLayout = PrefMgr.shared.basicKeyboardLayout
} label: {
Text("↻ㄅ" + " " + NSLocalizedString("Eten Trad.", comment: ""))
}
Button {
PrefMgr.shared.keyboardParser = 10
selKeyboardParser = PrefMgr.shared.keyboardParser
PrefMgr.shared.basicKeyboardLayout = "com.apple.keylayout.ABC"
selBasicKeyboardLayout = PrefMgr.shared.basicKeyboardLayout
} label: {
Text("↻A")
}
}
}
Preferences.Section(label: { Text(LocalizedStringKey("Phonetic Parser:")) }) {
HStack {
Picker(
@ -127,23 +155,9 @@ struct suiPrefPaneKeyboard: View {
Text(LocalizedStringKey("Universal Pinyin with Numeral Intonation")).tag(14)
}
}
.fixedSize()
.labelsHidden()
Button {
PrefMgr.shared.keyboardParser = 0
selKeyboardParser = PrefMgr.shared.keyboardParser
PrefMgr.shared.basicKeyboardLayout = "com.apple.keylayout.ZhuyinBopomofo"
selBasicKeyboardLayout = PrefMgr.shared.basicKeyboardLayout
} label: {
Text("↻ㄅ")
}
Button {
PrefMgr.shared.keyboardParser = 10
selKeyboardParser = PrefMgr.shared.keyboardParser
PrefMgr.shared.basicKeyboardLayout = "com.apple.keylayout.ABC"
selBasicKeyboardLayout = PrefMgr.shared.basicKeyboardLayout
} label: {
Text("↻A")
}
Spacer()
}
.frame(width: 380.0)
HStack {

View File

@ -82,6 +82,8 @@
"Clear Memorized Phrases" = "Clear Memorized Phrases";
"Currency Numeral Output" = "Currency Numeral Output";
"Hold ⇧ to choose associates." = "Hold ⇧ to choose associates.";
"Dachen Trad." = "Dachen Trad.";
"Eten Trad." = "Eten Trad.";
// The followings are the category names used in the Symbol menu.
"catCommonSymbols" = "CommonSymbols";
@ -202,6 +204,7 @@
"Phonetic Parser:" = "Phonetic Parser:";
"Please use mouse wheel to scroll this page. The CheatSheet is available in the IME menu." = "Please use mouse wheel to scroll this page. The CheatSheet is available in the IME menu.";
"Push the cursor in front of the phrase after selection" = "Push the cursor in front of the phrase after selection";
"Quick Setup:" = "Quick Setup:";
"Secondary Pinyin with Numeral Intonation" = "Secondary Pinyin with Numeral Intonation";
"Seigyou" = "Seigyou (JinYei)";
"Selection Keys:" = "Selection Keys:";

View File

@ -82,6 +82,8 @@
"Clear Memorized Phrases" = "Clear Memorized Phrases";
"Currency Numeral Output" = "Currency Numeral Output";
"Hold ⇧ to choose associates." = "Hold ⇧ to choose associates.";
"Dachen Trad." = "Dachen Trad.";
"Eten Trad." = "Eten Trad.";
// The followings are the category names used in the Symbol menu.
"catCommonSymbols" = "CommonSymbols";
@ -202,6 +204,7 @@
"Phonetic Parser:" = "Phonetic Parser:";
"Please use mouse wheel to scroll this page. The CheatSheet is available in the IME menu." = "Please use mouse wheel to scroll this page. The CheatSheet is available in the IME menu.";
"Push the cursor in front of the phrase after selection" = "Push the cursor in front of the phrase after selection";
"Quick Setup:" = "Quick Setup:";
"Secondary Pinyin with Numeral Intonation" = "Secondary Pinyin with Numeral Intonation";
"Seigyou" = "Seigyou (JinYei)";
"Selection Keys:" = "Selection Keys:";

View File

@ -82,6 +82,8 @@
"Clear Memorized Phrases" = "臨時記憶資料を削除";
"Currency Numeral Output" = "数字大字変換";
"Hold ⇧ to choose associates." = "⇧を押しながら連想候補を選択。";
"Dachen Trad." = "大千伝統";
"Eten Trad." = "倚天伝統";
// The followings are the category names used in the Symbol menu.
"catCommonSymbols" = "常用";
@ -202,6 +204,7 @@
"Phonetic Parser:" = "注音配列:";
"Please use mouse wheel to scroll this page. The CheatSheet is available in the IME menu." = "マウスホイールでこのページをご覧ください。キーに関する取扱説明のアクセスはメニューに。";
"Push the cursor in front of the phrase after selection" = "候補選択の直後、すぐカーソルを単語の向こうに推し進める";
"Quick Setup:" = "直接設定:";
"Secondary Pinyin with Numeral Intonation" = "国音二式 (ローマ字+数字音調)";
"Seigyou" = "精業配列";
"Selection Keys:" = "言選り用キー:";

View File

@ -82,6 +82,8 @@
"Clear Memorized Phrases" = "清除临时记忆语汇资料";
"Currency Numeral Output" = "大写汉字数字输出";
"Hold ⇧ to choose associates." = "摁住⇧以选取联想词。";
"Dachen Trad." = "大千传统";
"Eten Trad." = "倚天传统";
// The followings are the category names used in the Symbol menu.
"catCommonSymbols" = "常用";
@ -202,6 +204,7 @@
"Phonetic Parser:" = "注音排列:";
"Please use mouse wheel to scroll this page. The CheatSheet is available in the IME menu." = "请利用滑鼠滚轮检视该页面。也请洽输入法选单内的热键指南。";
"Push the cursor in front of the phrase after selection" = "在选字后将游标置于该字词的前方";
"Quick Setup:" = "直接设定:";
"Secondary Pinyin with Numeral Intonation" = "国音二式+数字标调";
"Seigyou" = "精业排列";
"Selection Keys:" = "选字键:";

View File

@ -82,6 +82,8 @@
"Clear Memorized Phrases" = "清除臨時記憶語彙資料";
"Currency Numeral Output" = "大寫漢字數字輸出";
"Hold ⇧ to choose associates." = "摁住⇧以選取聯想詞。";
"Dachen Trad." = "大千傳統";
"Eten Trad." = "倚天傳統";
// The followings are the category names used in the Symbol menu.
"catCommonSymbols" = "常用";
@ -202,6 +204,7 @@
"Phonetic Parser:" = "注音排列:";
"Please use mouse wheel to scroll this page. The CheatSheet is available in the IME menu." = "請利用滑鼠滾輪檢視該頁面。也請洽輸入法選單內的熱鍵指南。";
"Push the cursor in front of the phrase after selection" = "在選字後將游標置於該字詞的前方";
"Quick Setup:" = "直接設定:";
"Secondary Pinyin with Numeral Intonation" = "國音二式+數字標調";
"Seigyou" = "精業排列";
"Selection Keys:" = "選字鍵:";