lv_group_create: init focus_cb
This commit is contained in:
@@ -47,6 +47,7 @@ lv_group_t * lv_group_create(void)
|
|||||||
group->style_mod = style_mod_def;
|
group->style_mod = style_mod_def;
|
||||||
group->obj_focus = NULL;
|
group->obj_focus = NULL;
|
||||||
group->frozen = 0;
|
group->frozen = 0;
|
||||||
|
group->focus_cb = NULL;
|
||||||
|
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
@@ -88,6 +89,10 @@ void lv_group_remove_obj(lv_obj_t * obj)
|
|||||||
lv_group_t * g = obj->group_p;
|
lv_group_t * g = obj->group_p;
|
||||||
if(g == NULL) return;
|
if(g == NULL) return;
|
||||||
|
|
||||||
|
if(*g->obj_focus == obj) {
|
||||||
|
lv_group_focus_next(g);
|
||||||
|
}
|
||||||
|
|
||||||
/*Search the object and remove it from its group */
|
/*Search the object and remove it from its group */
|
||||||
lv_obj_t ** i;
|
lv_obj_t ** i;
|
||||||
LL_READ(g->obj_ll, i) {
|
LL_READ(g->obj_ll, i) {
|
||||||
@@ -98,10 +103,7 @@ void lv_group_remove_obj(lv_obj_t * obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(*g->obj_focus == obj) {
|
|
||||||
g->obj_focus = NULL;
|
|
||||||
lv_group_focus_next(g);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -284,6 +284,11 @@ lv_res_t lv_obj_del(lv_obj_t * obj)
|
|||||||
lv_anim_del(obj, NULL);
|
lv_anim_del(obj, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*Delete from the group*/
|
||||||
|
#if USE_LV_GROUP
|
||||||
|
if(obj->group_p != NULL) lv_group_remove_obj(obj);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Reset all input devices if
|
/* Reset all input devices if
|
||||||
* the currently pressed object is deleted*/
|
* the currently pressed object is deleted*/
|
||||||
lv_indev_t * indev = lv_indev_next(NULL);
|
lv_indev_t * indev = lv_indev_next(NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user