Skip to content

Commit

Permalink
allow auto expand in scroll mode (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored Sep 18, 2024
1 parent 11ffcda commit 46dc98b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build
sudo cmake --install build
```
After the first time you execute `cmake --install`, you need to logout and login,
then add Fcitx5 in System Setttings -> Keyboard -> Input Sources, Chinese Simplified.

For installations afterwards, clicking `Restart` in Fcitx5 menu suffices.

### Code sign
Some features (e.g. notifications, core dump) require the app bundle be code-signed after installation:
Expand Down
2 changes: 1 addition & 1 deletion tests/testconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int main() {
}

// Can get available input methods.
{ std::cerr << imGetAvailableIMs() << std::endl; }
std::cerr << imGetAvailableIMs() << std::endl;

// Can set config
std::vector<std::string> values{"False", "True"};
Expand Down
4 changes: 4 additions & 0 deletions webpanel/webpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ void WebPanel::update(UserInterfaceComponent component,
candidate_window::scroll_state_t::scrolling) {
return expand();
}
if (*config_.scrollMode->autoExpand) {
scrollState_ = candidate_window::scroll_state_t::scrolling;
return expand();
}
scrollState_ = candidate_window::scroll_state_t::ready;
} else {
scrollState_ = candidate_window::scroll_state_t::none;
Expand Down
1 change: 1 addition & 0 deletions webpanel/webpanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ FCITX_CONFIGURATION(
FCITX_CONFIGURATION(
ScrollConfig,
Option<bool> enableScroll{this, "EnableScroll", _("Enable scroll"), true};
Option<bool> autoExpand{this, "AutoExpand", _("Auto expand"), false};
Option<KeyList> expand{this, "Expand", _("Expand"), {Key(FcitxKey_Down)}};
Option<KeyList> collapse{this, "Collapse", _("Collapse"), {}};
Option<KeyList> up{this, "Up", _("Up"), {Key(FcitxKey_Up)}};
Expand Down

0 comments on commit 46dc98b

Please sign in to comment.