mirror of
https://github.com/lvgl/lvgl.git
synced 2024-11-23 01:33:59 +08:00
fix(ime_pinyin): make ime_pinyin_set_keyboard() change the parent of pinyin IME to the keyboard's parent
fixes: #3749
This commit is contained in:
parent
ab2446c247
commit
1bad397caf
@ -434,6 +434,8 @@ void lv_ime_pinyin_set_keyboard(lv_obj_t * obj, lv_obj_t * kb)
|
||||
lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj;
|
||||
|
||||
pinyin_ime->kb = kb;
|
||||
lv_obj_set_parent(obj, lv_obj_get_parent(kb));
|
||||
lv_obj_set_parent(pinyin_ime->cand_panel, lv_obj_get_parent(kb));
|
||||
lv_obj_add_event_cb(pinyin_ime->kb, lv_ime_pinyin_kb_event, LV_EVENT_VALUE_CHANGED, obj);
|
||||
lv_obj_align_to(pinyin_ime->cand_panel, pinyin_ime->kb, LV_ALIGN_OUT_TOP_MID, 0, 0);
|
||||
}
|
||||
@ -569,7 +571,7 @@ static void lv_ime_pinyin_constructor(const lv_obj_class_t * class_p, lv_obj_t *
|
||||
#endif
|
||||
|
||||
/* Init pinyin_ime->cand_panel */
|
||||
pinyin_ime->cand_panel = lv_btnmatrix_create(lv_scr_act());
|
||||
pinyin_ime->cand_panel = lv_btnmatrix_create(lv_obj_get_parent(obj));
|
||||
lv_btnmatrix_set_map(pinyin_ime->cand_panel, (const char **)lv_btnm_def_pinyin_sel_map);
|
||||
lv_obj_set_size(pinyin_ime->cand_panel, LV_PCT(100), LV_PCT(5));
|
||||
lv_obj_add_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN);
|
||||
|
Loading…
Reference in New Issue
Block a user