PrefUI_Keyboard // Add reset buttons and mistake-proofing.
This commit is contained in:
parent
01095a9bcd
commit
5f078d7c40
|
@ -138,7 +138,6 @@
|
|||
"Phonetic Parser:" = "注音排列:";
|
||||
"Push the cursor in front of the phrase after selection" = "在选字后将游标置于该字词的前方";
|
||||
"Secondary Pinyin with Numeral Intonation" = "国音二式+数字标调";
|
||||
"Secondary Pinyin with Numeral Intonation" = "國音二式+数字标调";
|
||||
"Selection Keys:" = "选字键:";
|
||||
"Show Hanyu-Pinyin in the inline composition buffer" = "拼音并击模式(组字区内看到的是汉语拼音)";
|
||||
"Show page buttons in candidate window" = "在选字窗内显示翻页按钮";
|
||||
|
@ -155,4 +154,3 @@
|
|||
"Use ESC key to clear the entire input buffer" = "敲 ESC 键以清空整个组字缓冲区";
|
||||
"Vertical" = "纵向布局";
|
||||
"Yale Pinyin with Numeral Intonation" = "耶鲁拼音+数字标调";
|
||||
"Yale Pinyin with Numeral Intonation" = "耶魯拼音+数字标调";
|
||||
|
|
|
@ -45,30 +45,60 @@ struct suiPrefPaneKeyboard: View {
|
|||
var body: some View {
|
||||
Preferences.Container(contentWidth: contentWidth) {
|
||||
Preferences.Section(label: { Text(LocalizedStringKey("Phonetic Parser:")) }) {
|
||||
Picker("", selection: $selMandarinParser) {
|
||||
Group {
|
||||
Text(LocalizedStringKey("Dachen (Microsoft Standard / Wang / 01, etc.)")).tag(0)
|
||||
Text(LocalizedStringKey("Dachen 26 (libChewing)")).tag(7)
|
||||
Text(LocalizedStringKey("Eten Traditional")).tag(1)
|
||||
Text(LocalizedStringKey("Eten 26")).tag(3)
|
||||
Text(LocalizedStringKey("IBM")).tag(4)
|
||||
Text(LocalizedStringKey("Hsu")).tag(2)
|
||||
Text(LocalizedStringKey("MiTAC")).tag(5)
|
||||
Text(LocalizedStringKey("Fake Seigyou")).tag(6)
|
||||
HStack {
|
||||
Picker("", selection: $selMandarinParser) {
|
||||
Group {
|
||||
Text(LocalizedStringKey("Dachen (Microsoft Standard / Wang / 01, etc.)")).tag(0)
|
||||
Text(LocalizedStringKey("Dachen 26 (libChewing)")).tag(7)
|
||||
Text(LocalizedStringKey("Eten Traditional")).tag(1)
|
||||
Text(LocalizedStringKey("Eten 26")).tag(3)
|
||||
Text(LocalizedStringKey("IBM")).tag(4)
|
||||
Text(LocalizedStringKey("Hsu")).tag(2)
|
||||
Text(LocalizedStringKey("MiTAC")).tag(5)
|
||||
Text(LocalizedStringKey("Fake Seigyou")).tag(6)
|
||||
}
|
||||
Divider()
|
||||
Group {
|
||||
Text(LocalizedStringKey("Hanyu Pinyin with Numeral Intonation")).tag(10)
|
||||
Text(LocalizedStringKey("Secondary Pinyin with Numeral Intonation")).tag(11)
|
||||
Text(LocalizedStringKey("Yale Pinyin with Numeral Intonation")).tag(12)
|
||||
Text(LocalizedStringKey("Hualuo Pinyin with Numeral Intonation")).tag(13)
|
||||
Text(LocalizedStringKey("Universal Pinyin with Numeral Intonation")).tag(14)
|
||||
}
|
||||
}.onChange(of: selMandarinParser) { value in
|
||||
mgrPrefs.mandarinParser = value
|
||||
switch value {
|
||||
case 0:
|
||||
if !AppleKeyboardConverter.arrDynamicBasicKeyLayout.contains(mgrPrefs.basicKeyboardLayout) {
|
||||
mgrPrefs.basicKeyboardLayout = "com.apple.keylayout.ZhuyinBopomofo"
|
||||
selBasicKeyboardLayout = mgrPrefs.basicKeyboardLayout
|
||||
}
|
||||
default:
|
||||
if AppleKeyboardConverter.arrDynamicBasicKeyLayout.contains(mgrPrefs.basicKeyboardLayout) {
|
||||
mgrPrefs.basicKeyboardLayout = "com.apple.keylayout.ABC"
|
||||
selBasicKeyboardLayout = mgrPrefs.basicKeyboardLayout
|
||||
}
|
||||
}
|
||||
}
|
||||
Divider()
|
||||
Group {
|
||||
Text(LocalizedStringKey("Hanyu Pinyin with Numeral Intonation")).tag(10)
|
||||
Text(LocalizedStringKey("Secondary Pinyin with Numeral Intonation")).tag(11)
|
||||
Text(LocalizedStringKey("Yale Pinyin with Numeral Intonation")).tag(12)
|
||||
Text(LocalizedStringKey("Hualuo Pinyin with Numeral Intonation")).tag(13)
|
||||
Text(LocalizedStringKey("Universal Pinyin with Numeral Intonation")).tag(14)
|
||||
.labelsHidden()
|
||||
Button {
|
||||
mgrPrefs.mandarinParser = 0
|
||||
selMandarinParser = mgrPrefs.mandarinParser
|
||||
mgrPrefs.basicKeyboardLayout = "com.apple.keylayout.ZhuyinBopomofo"
|
||||
selBasicKeyboardLayout = mgrPrefs.basicKeyboardLayout
|
||||
} label: {
|
||||
Text("↻ㄅ")
|
||||
}
|
||||
Button {
|
||||
mgrPrefs.mandarinParser = 10
|
||||
selMandarinParser = mgrPrefs.mandarinParser
|
||||
mgrPrefs.basicKeyboardLayout = "com.apple.keylayout.ABC"
|
||||
selBasicKeyboardLayout = mgrPrefs.basicKeyboardLayout
|
||||
} label: {
|
||||
Text("↻A")
|
||||
}
|
||||
}.onChange(of: selMandarinParser) { value in
|
||||
mgrPrefs.mandarinParser = value
|
||||
}
|
||||
.labelsHidden()
|
||||
.frame(width: 320.0)
|
||||
.frame(width: 380.0)
|
||||
Text(LocalizedStringKey("Choose the phonetic layout for Mandarin parser."))
|
||||
.preferenceDescription()
|
||||
}
|
||||
|
@ -81,6 +111,10 @@ struct suiPrefPaneKeyboard: View {
|
|||
}.id(UUID())
|
||||
}.onChange(of: selBasicKeyboardLayout) { value in
|
||||
mgrPrefs.basicKeyboardLayout = value
|
||||
if AppleKeyboardConverter.arrDynamicBasicKeyLayout.contains(value) {
|
||||
mgrPrefs.mandarinParser = 0
|
||||
selMandarinParser = mgrPrefs.mandarinParser
|
||||
}
|
||||
}
|
||||
.labelsHidden()
|
||||
.frame(width: 240.0)
|
||||
|
|
Loading…
Reference in New Issue