Skip to content

Commit 8c47e30

Browse files
committed
rename
1 parent 3d9cb09 commit 8c47e30

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

im/pinyin/pinyin.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,10 +1950,11 @@ void PinyinEngine::keyEvent(const InputMethodEntry &entry, KeyEvent &event) {
19501950
resetPredict(inputContext);
19511951
if (event.key().check(FcitxKey_Escape) ||
19521952
(event.key().check(FcitxKey_BackSpace) &&
1953-
(*config_.treatBackspaceAsEscapeOnPrediction ==
1954-
TreatBackspaceAsEscapeOnPrediction::Yes ||
1955-
(*config_.treatBackspaceAsEscapeOnPrediction ==
1956-
TreatBackspaceAsEscapeOnPrediction::WithVirtualKeyboard &&
1953+
(*config_.backspaceBehaviorOnPrediction ==
1954+
BackspaceBehaviorOnPrediction::OnlyClearCandidates ||
1955+
(*config_.backspaceBehaviorOnPrediction ==
1956+
BackspaceBehaviorOnPrediction::
1957+
BackspaceWhenNotUsingOnScreenKeyboard &&
19571958
event.isVirtual()))) ||
19581959
event.key().check(FcitxKey_Delete)) {
19591960
event.filterAndAccept();

im/pinyin/pinyin.h

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,16 @@ enum class PreeditMode { No, ComposingPinyin, CommitPreview };
9898
FCITX_CONFIG_ENUM_NAME_WITH_I18N(PreeditMode, N_("Do not show"),
9999
N_("Composing pinyin"), N_("Commit preview"))
100100

101-
enum class TreatBackspaceAsEscapeOnPrediction { No, WithVirtualKeyboard, Yes };
101+
enum class BackspaceBehaviorOnPrediction {
102+
OnlyClearCandidates,
103+
ClearCandidatesAndBackspace,
104+
BackspaceWhenNotUsingOnScreenKeyboard
105+
};
102106

103-
FCITX_CONFIG_ENUM_NAME_WITH_I18N(TreatBackspaceAsEscapeOnPrediction, N_("No"),
104-
N_("With virtual keyboard"), N_("Yes"))
107+
FCITX_CONFIG_ENUM_NAME_WITH_I18N(
108+
BackspaceBehaviorOnPrediction, N_("Only Clear candidates"),
109+
N_("Clear candidates & backspace"),
110+
N_("Backspace when not using on-screen keyboard"))
105111

106112
enum class CorrectionLayout {
107113
None,
@@ -193,12 +199,12 @@ FCITX_CONFIGURATION(
193199
isAndroid()};
194200
Option<int, IntConstrain> predictionSize{
195201
this, "PredictionSize", _("Prediction Size"), 49, IntConstrain(3, 100)};
196-
OptionWithAnnotation<TreatBackspaceAsEscapeOnPrediction,
197-
TreatBackspaceAsEscapeOnPredictionI18NAnnotation>
198-
treatBackspaceAsEscapeOnPrediction{
199-
this, "TreatBackspaceAsEscapeOnPrediction",
200-
_("Treat BackSpace as Escape on prediction"),
201-
TreatBackspaceAsEscapeOnPrediction::WithVirtualKeyboard};
202+
OptionWithAnnotation<BackspaceBehaviorOnPrediction,
203+
BackspaceBehaviorOnPredictionI18NAnnotation>
204+
backspaceBehaviorOnPrediction{
205+
this, "BackspaceBehaviorOnPrediction",
206+
_("Backspace behavior on prediction"),
207+
BackspaceBehaviorOnPrediction::BackspaceWhenNotUsingOnScreenKeyboard};
202208
OptionWithAnnotation<SwitchInputMethodBehavior,
203209
SwitchInputMethodBehaviorI18NAnnotation>
204210
switchInputMethodBehavior{this, "SwitchInputMethodBehavior",

0 commit comments

Comments
 (0)