From 878c53ab44adbb0e144fde2cce615f9c00a9f4d1 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sat, 14 May 2022 18:45:57 +0800 Subject: [PATCH] mgrPref // +InlineDumpPinyinInLieuOfZhuyin. --- Source/Modules/IMEModules/mgrPrefs.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Modules/IMEModules/mgrPrefs.swift b/Source/Modules/IMEModules/mgrPrefs.swift index bf345dd5..8a99c805 100644 --- a/Source/Modules/IMEModules/mgrPrefs.swift +++ b/Source/Modules/IMEModules/mgrPrefs.swift @@ -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)