Skip to content

Commit a513da3

Browse files
committed
refactor: polish candidates window settings wording
1 parent 55c632f commit a513da3

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

app/src/main/java/com/osfans/trime/data/prefs/AppPrefs.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ class AppPrefs(
188188
shared: SharedPreferences,
189189
) : PreferenceDelegateOwner(shared, R.string.candidates_window) {
190190
companion object {
191-
const val MODE = "candidates__mode"
192-
const val POSITION = "candidates__position"
191+
const val MODE = "show_candidates_window"
192+
const val POSITION = "candidates_window_position"
193193
}
194194

195-
val mode = enum(R.string.candidates_mode, MODE, PopupCandidatesMode.DISABLED)
196-
val position = enum(R.string.display_position, POSITION, PopupPosition.BOTTOM_LEFT)
195+
val mode = enum(R.string.show_candidates_window, MODE, PopupCandidatesMode.DISABLED)
196+
val position = enum(R.string.candidates_window_position, POSITION, PopupPosition.BOTTOM_LEFT)
197197
}
198198

199199
/**

app/src/main/java/com/osfans/trime/ime/bar/QuickBar.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class QuickBar(
160160

161161
override fun onInputContextUpdate(ctx: RimeProto.Context) {
162162
// TODO: 临时修复状态栏与悬浮窗同时显示,后续需优化:考虑分离数据或寻找更好的实现方式
163-
if (candidatesMode == PopupCandidatesMode.FORCE_SHOW) return
163+
if (candidatesMode == PopupCandidatesMode.ALWAYS_SHOW) return
164164

165165
barStateMachine.push(
166166
QuickBarStateMachine.TransitionEvent.CandidatesUpdated,

app/src/main/java/com/osfans/trime/ime/candidates/popup/PopupCandidatesMode.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ enum class PopupCandidatesMode(
1313
) : PreferenceDelegateEnum {
1414
SYSTEM_DEFAULT(R.string.system_default),
1515
INPUT_DEVICE(R.string.depends_on_input_device),
16-
FORCE_SHOW(R.string.force_show),
16+
ALWAYS_SHOW(R.string.always_show),
1717
DISABLED(R.string.disable),
1818
}

app/src/main/java/com/osfans/trime/ime/composition/PreeditModule.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class PreeditModule(
7373

7474
override fun onInputContextUpdate(ctx: RimeProto.Context) {
7575
// TODO: 临时修复状态栏与悬浮窗同时显示,后续需优化:考虑分离数据或寻找更好的实现方式
76-
if (candidatesMode == PopupCandidatesMode.FORCE_SHOW) return
76+
if (candidatesMode == PopupCandidatesMode.ALWAYS_SHOW) return
7777

7878
ui.update(ctx.composition)
7979
if (ctx.composition.length > 0) {

app/src/main/java/com/osfans/trime/ime/core/InputDeviceManager.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class InputDeviceManager {
2727
}
2828

2929
private fun setupComposingPopupWindowCallback(isVirtual: Boolean) {
30-
val shouldSetupWindow = !isVirtual || candidatesMode == PopupCandidatesMode.FORCE_SHOW
30+
val shouldSetupWindow = !isVirtual || candidatesMode == PopupCandidatesMode.ALWAYS_SHOW
3131
composingPopupWindow?.handleMessage = shouldSetupWindow
3232
composingPopupWindow?.useVirtualKeyboard = isVirtual
3333
// dismiss ComposingPopupWindow when entering virtual keyboard mode,
@@ -85,7 +85,7 @@ class InputDeviceManager {
8585
when (candidatesMode) {
8686
PopupCandidatesMode.SYSTEM_DEFAULT -> service.superEvaluateInputViewShown()
8787
PopupCandidatesMode.INPUT_DEVICE -> isVirtualKeyboard
88-
PopupCandidatesMode.FORCE_SHOW -> true
88+
PopupCandidatesMode.ALWAYS_SHOW -> true
8989
PopupCandidatesMode.DISABLED -> true
9090
}
9191
applyMode(service, useVirtualKeyboard)
@@ -123,7 +123,7 @@ class InputDeviceManager {
123123
when (candidatesMode) {
124124
PopupCandidatesMode.SYSTEM_DEFAULT -> service.superEvaluateInputViewShown()
125125
PopupCandidatesMode.INPUT_DEVICE -> false
126-
PopupCandidatesMode.FORCE_SHOW -> false
126+
PopupCandidatesMode.ALWAYS_SHOW -> false
127127
PopupCandidatesMode.DISABLED -> true
128128
}
129129
applyMode(service, useVirtualKeyboard)
@@ -147,7 +147,7 @@ class InputDeviceManager {
147147
PopupCandidatesMode.SYSTEM_DEFAULT -> service.superEvaluateInputViewShown()
148148
PopupCandidatesMode.INPUT_DEVICE ->
149149
toolType == MotionEvent.TOOL_TYPE_FINGER || toolType == MotionEvent.TOOL_TYPE_STYLUS
150-
PopupCandidatesMode.FORCE_SHOW -> false
150+
PopupCandidatesMode.ALWAYS_SHOW -> false
151151
PopupCandidatesMode.DISABLED -> true
152152
}
153153
applyMode(service, useVirtualKeyboard)

app/src/main/res/values-zh-rCN/strings.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -217,20 +217,20 @@ SPDX-License-Identifier: GPL-3.0-or-later
217217
<string name="synchronization">同步</string>
218218
<string name="profile_timing_background_sync_set_time">设置后台同步时间</string>
219219
<string name="candidates_window">候选窗口</string>
220-
<string name="candidates_mode">候选词显示模式</string>
220+
<string name="show_candidates_window">显示候选词窗口</string>
221221
<string name="general">常规</string>
222222
<string name="preedit">预编辑码</string>
223223
<string name="commit_text_preview">首选词预览</string>
224224
<string name="raw_input">原始输入码</string>
225225
<string name="composing_text_mode">在程序中显示撰写文本</string>
226226
<string name="depends_on_input_device">根据输入设备而定</string>
227-
<string name="force_show">强制显示</string>
227+
<string name="always_show">始终显示</string>
228228
<string name="follow_cursor">跟随光标</string>
229229
<string name="bottom_left">左下</string>
230230
<string name="bottom_right">右下</string>
231231
<string name="top_left">左上</string>
232232
<string name="top_right">右上</string>
233-
<string name="display_position">显示位置</string>
233+
<string name="candidates_window_position">候选词窗口位置</string>
234234
<string name="deploy_failure">部署失败</string>
235235
<string name="view_deploy_failure_log">部署失败。点此查看错误日志。</string>
236236
</resources>

app/src/main/res/values-zh-rTW/strings.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -216,21 +216,21 @@ SPDX-License-Identifier: GPL-3.0-or-later
216216
<string name="forget_this_word">忘記該詞</string>
217217
<string name="synchronization">同步</string>
218218
<string name="profile_timing_background_sync_set_time">設定後台同步時間</string>
219-
<string name="candidates_window">候选窗口</string>
220-
<string name="candidates_mode">候選詞顯示模式</string>
219+
<string name="candidates_window">候选視窗</string>
220+
<string name="show_candidates_window">顯示候選詞視窗</string>
221221
<string name="general">常規</string>
222222
<string name="preedit">預編輯碼</string>
223223
<string name="commit_text_preview">首選詞預覽</string>
224224
<string name="raw_input">原始輸入碼</string>
225225
<string name="composing_text_mode">在程式中顯示撰寫文字</string>
226226
<string name="depends_on_input_device">視輸入設備而定</string>
227-
<string name="force_show">強制顯示</string>
227+
<string name="always_show">始終顯示</string>
228228
<string name="follow_cursor">跟隨游標</string>
229229
<string name="bottom_left">左下</string>
230230
<string name="bottom_right">右下</string>
231231
<string name="top_left">左上</string>
232232
<string name="top_right">右上</string>
233-
<string name="display_position">顯示位置</string>
233+
<string name="candidates_window_position">候選詞視窗位置</string>
234234
<string name="deploy_failure">部署失敗</string>
235235
<string name="view_deploy_failure_log">部署失敗。點此檢視錯誤日誌。</string>
236236
</resources>

app/src/main/res/values/strings.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -217,20 +217,20 @@ SPDX-License-Identifier: GPL-3.0-or-later
217217
<string name="synchronization">Synchronization</string>
218218
<string name="profile_timing_background_sync_set_time">Set background sync time</string>
219219
<string name="candidates_window">Candidates Window</string>
220-
<string name="candidates_mode">Candidates mode</string>
220+
<string name="show_candidates_window">Show candidates window</string>
221221
<string name="general">General</string>
222222
<string name="preedit">Preedit</string>
223223
<string name="commit_text_preview">Commit text preview</string>
224224
<string name="raw_input">Raw input</string>
225225
<string name="composing_text_mode">Show composing text in editor</string>
226226
<string name="depends_on_input_device">Depends on input device</string>
227-
<string name="force_show">Force show</string>
227+
<string name="always_show">Always show</string>
228228
<string name="follow_cursor">Follow cursor</string>
229229
<string name="bottom_left">Bottom left</string>
230230
<string name="bottom_right">Bottom right</string>
231231
<string name="top_left">Top left</string>
232232
<string name="top_right">Top right</string>
233-
<string name="display_position">Display position</string>
233+
<string name="candidates_window_position">Candidates window position</string>
234234
<string name="deploy_failure">Deploy failure</string>
235235
<string name="view_deploy_failure_log">Deploy failure. Click here to view error log.</string>
236236
</resources>

0 commit comments

Comments
 (0)