diff --git a/src/hallelujah.cpp b/src/hallelujah.cpp index aac78cf..adcd873 100644 --- a/src/hallelujah.cpp +++ b/src/hallelujah.cpp @@ -103,16 +103,17 @@ void HallelujahState::updatePreedit(InputContext *ic) { preedit.setCursor(buffer_.cursor()); } - PreeditMode mode = ic->capabilityFlags().test(CapabilityFlag::Preedit) - ? *engine_->config().preeditMode - : PreeditMode::No; + hallelujah::PreeditMode mode = + ic->capabilityFlags().test(CapabilityFlag::Preedit) + ? *engine_->config().preeditMode + : hallelujah::PreeditMode::No; auto &inputPanel = ic->inputPanel(); switch (mode) { - case PreeditMode::No: + case hallelujah::PreeditMode::No: inputPanel.setPreedit(preedit); inputPanel.setClientPreedit(Text()); break; - case PreeditMode::ComposingText: + case hallelujah::PreeditMode::ComposingText: inputPanel.setClientPreedit(preedit); break; } diff --git a/src/hallelujah.h b/src/hallelujah.h index 0ab0c36..2dcee57 100644 --- a/src/hallelujah.h +++ b/src/hallelujah.h @@ -14,20 +14,24 @@ #include namespace fcitx { +namespace hallelujah { enum class PreeditMode { No, ComposingText }; FCITX_CONFIG_ENUM_NAME_WITH_I18N(PreeditMode, N_("Do not show"), N_("Composing text")) +} // namespace hallelujah -FCITX_CONFIGURATION( - HallelujahEngineConfig, - OptionWithAnnotation preeditMode{ - this, "PreeditMode", _("Preedit Mode"), PreeditMode::ComposingText}; - Option showIPA{this, "ShowIPA", _("Show IPA"), true}; - Option showTranslation{this, "ShowTranslation", _("Show translation"), - true}; - Option commitWithSpace{this, "CommitWithSpace", - _("Commit with space"), false};); +FCITX_CONFIGURATION(HallelujahEngineConfig, + OptionWithAnnotation + preeditMode{this, "PreeditMode", _("Preedit Mode"), + hallelujah::PreeditMode::ComposingText}; + Option showIPA{this, "ShowIPA", _("Show IPA"), true}; + Option showTranslation{this, "ShowTranslation", + _("Show translation"), true}; + Option commitWithSpace{this, "CommitWithSpace", + _("Commit with space"), + false};); struct HallelujahWord { HallelujahWord(const std::vector &translation,