mgrPref // +InlineDumpPinyinInLieuOfZhuyin.

This commit is contained in:
ShikiSuen 2022-05-14 18:45:57 +08:00
parent 94fcf061d2
commit 878c53ab44
1 changed files with 7 additions and 0 deletions

View File

@ -54,6 +54,7 @@ struct UserDef {
static let kMaxCandidateLength = "MaxCandidateLength"
static let kShouldNotFartInLieuOfBeep = "ShouldNotFartInLieuOfBeep"
static let kShowHanyuPinyinInCompositionBuffer = "ShowHanyuPinyinInCompositionBuffer"
static let kInlineDumpPinyinInLieuOfZhuyin = "InlineDumpPinyinInLieuOfZhuyin"
static let kCandidateTextFontName = "CandidateTextFontName"
static let kCandidateKeyLabelFontName = "CandidateKeyLabelFontName"
@ -232,6 +233,7 @@ public class mgrPrefs: NSObject {
UserDef.kMaxCandidateLength,
UserDef.kShouldNotFartInLieuOfBeep,
UserDef.kShowHanyuPinyinInCompositionBuffer,
UserDef.kInlineDumpPinyinInLieuOfZhuyin,
UserDef.kAssociatedPhrasesEnabled,
]
}
@ -277,6 +279,8 @@ public class mgrPrefs: NSObject {
UserDefaults.standard.setDefault(mgrPrefs.shouldNotFartInLieuOfBeep, forKey: UserDef.kShouldNotFartInLieuOfBeep)
UserDefaults.standard.setDefault(
mgrPrefs.showHanyuPinyinInCompositionBuffer, forKey: UserDef.kShowHanyuPinyinInCompositionBuffer)
UserDefaults.standard.setDefault(
mgrPrefs.inlineDumpPinyinInLieuOfZhuyin, forKey: UserDef.kInlineDumpPinyinInLieuOfZhuyin)
UserDefaults.standard.synchronize()
}
@ -359,6 +363,9 @@ public class mgrPrefs: NSObject {
@UserDefault(key: UserDef.kShowHanyuPinyinInCompositionBuffer, defaultValue: false)
static var showHanyuPinyinInCompositionBuffer: Bool
@UserDefault(key: UserDef.kInlineDumpPinyinInLieuOfZhuyin, defaultValue: false)
static var inlineDumpPinyinInLieuOfZhuyin: Bool
static func toggleShouldNotFartInLieuOfBeep() -> Bool {
shouldNotFartInLieuOfBeep = !shouldNotFartInLieuOfBeep
UserDefaults.standard.set(shouldNotFartInLieuOfBeep, forKey: UserDef.kShouldNotFartInLieuOfBeep)