Skip to content

Commit c81d1b5

Browse files
committed
lv_group: revert accidentally added merge fron dev-5.3
1 parent 4007834 commit c81d1b5

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

lv_core/lv_group.c

+3-23
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
**********************/
2424
static void style_mod_def(lv_style_t * style);
2525
static void style_mod_edit_def(lv_style_t * style);
26-
static void lv_group_refocus(lv_group_t *g);
2726

2827
/**********************
2928
* STATIC VARIABLES
@@ -93,7 +92,7 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
9392
/*If the object is already in a group and focused then defocuse it*/
9493
if(obj->group_p) {
9594
if(lv_obj_is_focused(obj)) {
96-
lv_group_refocus(obj->group_p);
95+
lv_group_focus_next(obj->group_p);
9796

9897
LV_LOG_INFO("group: assign object to an other group");
9998
}
@@ -108,7 +107,7 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
108107
/* If the head and the tail is equal then there is only one object in the linked list.
109108
* In this case automatically activate it*/
110109
if(lv_ll_get_head(&group->obj_ll) == next) {
111-
lv_group_refocus(group);
110+
lv_group_focus_next(group);
112111
}
113112
}
114113

@@ -122,16 +121,8 @@ void lv_group_remove_obj(lv_obj_t * obj)
122121
if(g == NULL) return;
123122
if(g->obj_focus == NULL) return; /*Just to be sure (Not possible if there is at least one object in the group)*/
124123

125-
/*Focus on the next object*/
126124
if(*g->obj_focus == obj) {
127-
/*If this is the only object in the group then focus to nothing.*/
128-
if(lv_ll_get_head(&g->obj_ll) == g->obj_focus && lv_ll_get_tail(&g->obj_ll) == g->obj_focus) {
129-
(*g->obj_focus)->signal_func(*g->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
130-
}
131-
/*If there more objects in the group then focus to the next/prev object*/
132-
else {
133-
lv_group_refocus(g);
134-
}
125+
lv_group_focus_next(g);
135126
}
136127

137128
/* If the focuses object is still the same then it was the only object in the group but it will be deleted.
@@ -329,17 +320,6 @@ void lv_group_set_click_focus(lv_group_t * group, bool en)
329320
group->click_focus = en ? 1 : 0;
330321
}
331322

332-
void lv_group_set_refocus_policy(lv_group_t * group, lv_group_refocus_policy_t policy) {
333-
group->refocus_policy = policy & 0x01;
334-
}
335-
336-
static void lv_group_refocus(lv_group_t *g) {
337-
if(g->refocus_policy == LV_GROUP_REFOCUS_POLICY_NEXT)
338-
lv_group_focus_next(g);
339-
else if(g->refocus_policy == LV_GROUP_REFOCUS_POLICY_PREV)
340-
lv_group_focus_prev(g);
341-
}
342-
343323
/**
344324
* Modify a style with the set 'style_mod' function. The input style remains unchanged.
345325
* @param group pointer to group

0 commit comments

Comments
 (0)