-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api): get_state_label returns the state label for UI display #553
Conversation
c02aa95
to
aee5599
Compare
@@ -980,95 +980,141 @@ void RimeSetCaretPos(RimeSessionId session_id, size_t caret_pos) { | |||
return ctx->set_caret_pos(caret_pos); | |||
} | |||
|
|||
RIME_API RimeApi* rime_get_api() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore the indentation change.
Only added a new function to the API at the end of the RimeApi
init block.
enable the frontend to display a message when an arbitrary option defined in the schema is updated. Closes rime#447 the option name eg. ascii_mode is passed to the notification handler function, there, get_state_label gives IME frontend the access to the human readable label for the current state of the option defined in *.schema:/switches/@*/states. when selection is changed in a radio group, more than one option in the group is updated so it only returns a non-empty label while querying the selected option.
aee5599
to
28fe1ba
Compare
It seems it is non trivial to implement this in squirrel, the session is handled in |
Session ID is given as an argument of the notification handler callback. |
应该还有后续啊。 状态选项里的单选状态组现在不支持通过快捷键切换,用不上这么好的文字提示,我准备把快捷键单选功能做好。 另外,我打算把 - { when: always, accept: Control+Shift+2, toggle: ascii_mode }
- { when: always, accept: Control+Shift+3, toggle: full_shape }
- { when: always, accept: Control+Shift+4, toggle: simplification }
- { when: always, accept: Control+Shift+5, toggle: extended_charset } 重新定义为 - { when: always, accept: Control+Shift+2, toggle: '@0' }
- { when: always, accept: Control+Shift+3, toggle: '@1' }
- { when: always, accept: Control+Shift+4, toggle: '@2' }
- { when: always, accept: Control+Shift+5, toggle: '@3' } 指改变方案中
|
如果是狀態組,可以用 |
enable the frontend to display a message when an arbitrary option defined in the
schema is updated.
Closes #447
the option name eg. ascii_mode is passed to the notification handler function,
there, get_state_label gives IME frontend the access to the human readable label
for the current state of the option defined in .schema:/switches/@/states.
when selection is changed in a radio group, more than one option in the group is
updated so it only returns a non-empty label while querying the selected option.
Pull request
Issue tracker
Fixes will automatically close the related issue
Fixes #
Feature
Describe feature of pull request
Unit test
Manual test
Code Review
Additional Info