mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
fix(event): fix lv_obj_clean not send event (#4902)
Signed-off-by: yushuailong1 <yushuailong1@xiaomi.com> Co-authored-by: yushuailong1 <yushuailong1@xiaomi.com>
This commit is contained in:
parent
e06285e7a5
commit
ba229b0708
@ -100,6 +100,7 @@ void lv_obj_clean(lv_obj_t * obj)
|
||||
|
||||
lv_obj_invalidate(obj);
|
||||
|
||||
uint32_t cnt = lv_obj_get_child_count(obj);
|
||||
lv_obj_t * child = lv_obj_get_first_not_deleting_child(obj);
|
||||
while(child) {
|
||||
obj_delete_core(child);
|
||||
@ -112,6 +113,11 @@ void lv_obj_clean(lv_obj_t * obj)
|
||||
obj->spec_attr->scroll.y = 0;
|
||||
}
|
||||
|
||||
if(lv_obj_get_child_count(obj) < cnt) {
|
||||
lv_obj_send_event(obj, LV_EVENT_CHILD_CHANGED, NULL);
|
||||
lv_obj_send_event(obj, LV_EVENT_CHILD_DELETED, NULL);
|
||||
}
|
||||
|
||||
LV_ASSERT_MEM_INTEGRITY();
|
||||
|
||||
LV_LOG_TRACE("finished (clean %p)", (void *)obj);
|
||||
|
Loading…
x
Reference in New Issue
Block a user