From b563cd08b02f1c779e71e8b3d0af6aa1b2b2c1d6 Mon Sep 17 00:00:00 2001 From: mokapsing <39441028+mokapsing@users.noreply.github.com> Date: Tue, 25 Jun 2024 16:54:41 +0800 Subject: [PATCH] hidden candidate by rime option --- src/rimestate.cpp | 4 +++- src/rimestate.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rimestate.cpp b/src/rimestate.cpp index 6a51591..e984add 100644 --- a/src/rimestate.cpp +++ b/src/rimestate.cpp @@ -438,7 +438,9 @@ void RimeState::updateUI(InputContext *ic, bool keyRelease) { updatePreedit(ic, context); - if (context.menu.num_candidates > 1) { + Bool isHidden = api->get_option(session, FCITX_HIDDEN_CANDIDATES); + + if (context.menu.num_candidates > 0 && !isHidden) { ic->inputPanel().setCandidateList( std::make_unique(engine_, ic, context)); } else { diff --git a/src/rimestate.h b/src/rimestate.h index 4377826..9c0abe0 100644 --- a/src/rimestate.h +++ b/src/rimestate.h @@ -20,6 +20,8 @@ #define RIME_ASCII_MODE "ascii_mode" +#define FCITX_HIDDEN_CANDIDATES "_hide_candidate" + namespace fcitx { class RimeEngine;