Skip to content

Commit

Permalink
improve candidates
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjimli committed Jan 12, 2024
1 parent c381b55 commit abd9175
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
2024/01/12
* 实现 conf\_doc\_foreach 函数(感谢林福提供补丁)
* 实现 data\_reader\_can\_read 函数(感谢林福提供补丁)
* 修复5keys输入中文后如果没有候选词时焦点会消失的问题(感谢颖健提供补丁)

2024/01/11
* 增加一个编译参数类型用于None的情况下识别编译传参类型以及修复app和awtk编译模式不同的问题(感谢智明提供补丁)
Expand Down
7 changes: 7 additions & 0 deletions src/ext_widgets/keyboard/candidates.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ static ret_t candidates_on_button_focused(void* ctx, event_t* e) {

static ret_t candidates_on_button_click(void* ctx, event_t* e) {
char str[32];
widget_t* focus = NULL;
widget_t* widget = WIDGET(ctx);
widget_t* button = WIDGET(e->target);
widget_t* keyboard = widget_get_window(widget);
Expand All @@ -69,8 +70,14 @@ static ret_t candidates_on_button_click(void* ctx, event_t* e) {
if (suggest_words->words_nr > 0) {
widget_set_focused(widget_get_child(button->parent, 0), TRUE);
candidates->is_suggest = TRUE;
} else {
focus = widget_get_focused_widget(keyboard);
widget_focus_down(focus);
}
log_debug("suggest_words->words:%s\n", suggest_words->words);
} else {
focus = widget_get_focused_widget(keyboard);
widget_focus_down(focus);
}
}
/* After commit text, if candidates is hidden we need to blur it and reset key_target! */
Expand Down

0 comments on commit abd9175

Please sign in to comment.