Skip to content

Commit

Permalink
fix: _hide_candidate didn't actually hide candidate bar
Browse files Browse the repository at this point in the history
feat: add `_hide_bar`, which playing the same role of `_hide_candidate`
  • Loading branch information
WhiredPlanck committed Feb 2, 2024
1 parent 6e4fdee commit 92fd2eb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 4 additions & 2 deletions app/src/main/java/com/osfans/trime/ime/core/InputView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,10 @@ class InputView(
"_hide_comment" -> {
quickBar.oldCandidateBar.candidates.setShowComment(!it.value)
}
"_hide_candidate" -> {
quickBar.oldCandidateBar.root.visibility =
"_hide_bar",
"_hide_candidate",
-> {
quickBar.view.visibility =
if (it.value) View.GONE else View.VISIBLE
}
"_hide_key_hint" -> keyboardWindow.oldMainInputView.mainKeyboardView.setShowHint(!it.value)
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/com/osfans/trime/ime/core/Trime.kt
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,12 @@ open class Trime : LifecycleInputMethodService() {
if (mCandidateRoot != null) {
loadBackground(true)
setShowComment(!Rime.getOption("_hide_comment"))
mCandidateRoot!!.visibility = if (!Rime.getOption("_hide_candidate")) View.VISIBLE else View.GONE
inputView?.quickBar?.view?.visibility =
if (!Rime.getOption("_hide_candidate") || !Rime.getOption("_hide_bar")) {
View.VISIBLE
} else {
View.GONE
}
mCandidate!!.reset()
mCompositionPopupWindow!!.isPopupWindowEnabled = (
prefs.keyboard.popupWindowEnabled &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ class TextInputManager private constructor() :
trime.inputFeedbackManager?.ttsLanguage =
locales[if (value) 1 else 0]
}
"_hide_candidate" -> {
"_hide_bar",
"_hide_candidate",
-> {
trime.setCandidatesViewShown(isComposable && !value)
}
"_liquid_keyboard" -> trime.selectLiquidKeyboard(0)
Expand Down

0 comments on commit 92fd2eb

Please sign in to comment.