mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-01 08:54:52 +08:00
lv_group_del: remove the objects from the groups too
This commit is contained in:
+12
-1
@@ -58,6 +58,18 @@ lv_group_t * lv_group_create(void)
|
|||||||
*/
|
*/
|
||||||
void lv_group_del(lv_group_t * group)
|
void lv_group_del(lv_group_t * group)
|
||||||
{
|
{
|
||||||
|
/*Defocus the the currently focussed object*/
|
||||||
|
if(group->obj_focus != NULL) {
|
||||||
|
(*group->obj_focus)->signal_func(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
|
||||||
|
lv_obj_invalidate(*group->obj_focus);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Remove the objects from the group*/
|
||||||
|
lv_obj_t ** obj;
|
||||||
|
LL_READ(group->obj_ll, obj) {
|
||||||
|
(*obj)->group_p = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
lv_ll_clear(&(group->obj_ll));
|
lv_ll_clear(&(group->obj_ll));
|
||||||
lv_mem_free(group);
|
lv_mem_free(group);
|
||||||
}
|
}
|
||||||
@@ -116,7 +128,6 @@ void lv_group_focus_obj(lv_obj_t * obj)
|
|||||||
if(g->frozen != 0) return;
|
if(g->frozen != 0) return;
|
||||||
|
|
||||||
lv_obj_t ** i;
|
lv_obj_t ** i;
|
||||||
|
|
||||||
LL_READ(g->obj_ll, i) {
|
LL_READ(g->obj_ll, i) {
|
||||||
if(*i == obj) {
|
if(*i == obj) {
|
||||||
if(g->obj_focus != NULL) {
|
if(g->obj_focus != NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user