rime / librime

Rime Input Method Engine, the core library
https://rime.im
BSD 3-Clause "New" or "Revised" License
3.39k stars 556 forks source link

Matrix view support API #618

Open LEOYoon-Tsaw opened 1 year ago

LEOYoon-Tsaw commented 1 year ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Many other IME support a matrix view, with MxN candidates arranged on M rows and N columns.

This is a Frontend layout, but navigations and selection need additional librime support to function. This is because:

  1. On the 2nd and further rows, the first candidate in row is not the 1st one as seen from librime's view.
  2. Up and down navigation will switch between changing highlight and paging, depending on the location of highlighted candidate.

One solution is to feed additional information to enable librime handle this layout. There are only 4 parameters librime needs to know:

  1. Index of 1st candidate in highlighted row
  2. Index of last candidate in row
  3. Index of candidate right above highlighted one(null if first row)
  4. Index of candidate right below highlighted one(null if last row)

Frontend can feed this information whenever it changes/along with every keystroke.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

This is the minimal API addition I can think of to support matrix view.

Additional context Add any other context or screenshots about the feature request here.

llity commented 1 year ago

不影响长句的使用,增加了便捷性。能自定义展开的行数。谢谢 image

LYWH commented 1 year ago

不影响长句的使用,增加了便捷性。能自定义展开的行数。谢谢 image

请问一下候选词行数您是怎样自定义的呀