23
23
**********************/
24
24
static void style_mod_def (lv_style_t * style );
25
25
static void style_mod_edit_def (lv_style_t * style );
26
- static void lv_group_refocus (lv_group_t * g );
27
26
28
27
/**********************
29
28
* STATIC VARIABLES
@@ -93,7 +92,7 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
93
92
/*If the object is already in a group and focused then defocuse it*/
94
93
if (obj -> group_p ) {
95
94
if (lv_obj_is_focused (obj )) {
96
- lv_group_refocus (obj -> group_p );
95
+ lv_group_focus_next (obj -> group_p );
97
96
98
97
LV_LOG_INFO ("group: assign object to an other group" );
99
98
}
@@ -108,7 +107,7 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
108
107
/* If the head and the tail is equal then there is only one object in the linked list.
109
108
* In this case automatically activate it*/
110
109
if (lv_ll_get_head (& group -> obj_ll ) == next ) {
111
- lv_group_refocus (group );
110
+ lv_group_focus_next (group );
112
111
}
113
112
}
114
113
@@ -122,16 +121,8 @@ void lv_group_remove_obj(lv_obj_t * obj)
122
121
if (g == NULL ) return ;
123
122
if (g -> obj_focus == NULL ) return ; /*Just to be sure (Not possible if there is at least one object in the group)*/
124
123
125
- /*Focus on the next object*/
126
124
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 );
135
126
}
136
127
137
128
/* 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)
329
320
group -> click_focus = en ? 1 : 0 ;
330
321
}
331
322
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
-
343
323
/**
344
324
* Modify a style with the set 'style_mod' function. The input style remains unchanged.
345
325
* @param group pointer to group
0 commit comments