1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

Merge pull request #1071 from ali-rostami/patch-2

defining lv_group_remove_all_objs
This commit is contained in:
Gabor Kiss-Vamosi 2019-05-20 06:45:32 +02:00 committed by GitHub
commit fd834ae60f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -193,6 +193,28 @@ void lv_group_remove_obj(lv_obj_t * obj)
}
}
/**
* Remove all objects from a group
* @param group pointer to a group
*/
void lv_group_remove_all_objs(lv_group_t * group)
{
/*Defocus the the currently focused object*/
if(group->obj_focus != NULL) {
(*group->obj_focus)->signal_cb(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
lv_obj_invalidate(*group->obj_focus);
group->obj_focus = NULL;
}
/*Remove the objects from the group*/
lv_obj_t ** obj;
LV_LL_READ(group->obj_ll, obj) {
(*obj)->group_p = NULL;
}
lv_ll_clear(&(group->obj_ll));
}
/**
* Focus on an object (defocus the current)
* @param obj pointer to an object to focus on

View File

@ -113,6 +113,12 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj);
*/
void lv_group_remove_obj(lv_obj_t * obj);
/**
* Remove all objects from a group
* @param group pointer to a group
*/
void lv_group_remove_all_objs(lv_group_t * group);
/**
* Focus on an object (defocus the current)
* @param obj pointer to an object to focus on