Skip to content

Feature/candidate grid scroll#1854

Open
antigoneum wants to merge 2 commits into
rime:masterfrom
antigoneum:feature/candidate-grid-scroll
Open

Feature/candidate grid scroll#1854
antigoneum wants to merge 2 commits into
rime:masterfrom
antigoneum:feature/candidate-grid-scroll

Conversation

@antigoneum
Copy link
Copy Markdown

Add optional candidate grid scroll layout

Summary

This PR adds an optional candidate grid layout for Weasel. When enabled through style
configuration, candidates can be shown as a fixed-column matrix and navigated by
row, similar to the native macOS candidate panel scroll behavior.

Generated with Codex assistance.

Behavior

  • Adds style/layout/grid to opt into grid rendering.
  • Adds style/layout/grid_columns, grid_visible_rows,
    grid_cell_width, and grid_cell_height for matrix sizing.
  • Defaults to a 5-column, 5-row visible candidate window.
  • Uses +, =, and numpad + to move the active row downward.
  • Uses - and numpad - to move the active row upward.
  • Uses number keys 1..grid_columns to select the candidate in the current row.
  • Scrolls the visible candidate window only after the active row moves past the
    5 visible rows.

Example configuration

patch:
  "menu/page_size": 25
  "style/horizontal": true
  "style/layout/type": horizontal
  "style/layout/grid": true
  "style/layout/grid_columns": 5
  "style/layout/grid_visible_rows": 5
  "style/layout/grid_cell_width": 62
  "style/layout/grid_cell_height": 27

Notes

The IPC style struct is extended with the grid fields, so all Weasel components
need to be rebuilt and installed from the same revision.

Test

  • Formatted touched C++ files with the repository .clang-format
    (BasedOnStyle: Chromium, SortIncludes: false).
  • Built local x64 WeaselUI and RimeWithWeasel targets on Windows with
    VS Build Tools.
  • WeaselServer compilation passed dependency targets but final link was
    blocked locally because output/WeaselServer.exe was running.
  • Verified grid rendering with a 5-column, 5-row visible candidate window.
  • Verified row movement and candidate selection with +, -, and number keys.
  • Verified DPI scaling for configured grid cell dimensions.

Generated with Codex assistance.
@fxliang
Copy link
Copy Markdown
Contributor

fxliang commented May 13, 2026

看上去像是要实现所谓的卷轴功能,但是目前这样的实现其实太多硬编逻辑,后面要清理是很难的。

预期更优的路径应该是librime要支持这种模式,设定卷轴行列,然后在开启了这种模式的时候不是用现有的单页的逻辑取数据,librime中selector或翻页等操作应该因应这种设定做对应的处理调整变化,等等。这样前端才不用硬编按键响应,行列信息等代码。

暂时更多只能是观望状态,望知悉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants