merge beta

This commit is contained in:
Gabor Kiss-Vamosi
2018-04-17 14:39:27 +02:00
29 changed files with 192 additions and 80 deletions

View File

@@ -47,6 +47,7 @@ lv_group_t * lv_group_create(void)
group->style_mod = style_mod_def;
group->obj_focus = NULL;
group->frozen = 0;
group->focus_cb = NULL;
return group;
}
@@ -88,6 +89,10 @@ void lv_group_remove_obj(lv_obj_t * obj)
lv_group_t * g = obj->group_p;
if(g == NULL) return;
if(*g->obj_focus == obj) {
lv_group_focus_next(g);
}
/*Search the object and remove it from its group */
lv_obj_t ** i;
LL_READ(g->obj_ll, i) {
@@ -97,11 +102,6 @@ void lv_group_remove_obj(lv_obj_t * obj)
obj->group_p = NULL;
}
}
if(*g->obj_focus == obj) {
g->obj_focus = NULL;
lv_group_focus_next(g);
}
}
/**

View File

@@ -61,6 +61,12 @@ typedef struct _lv_group_t
*/
lv_group_t * lv_group_create(void);
/**
* Delete a group object
* @param group pointer to a group
*/
void lv_group_del(lv_group_t * group);
/**
* Add an object to a group
* @param group pointer to a group

View File

@@ -655,10 +655,14 @@ static void indev_drag(lv_indev_proc_t * state)
lv_coord_t act_y = lv_obj_get_y(drag_obj);
uint16_t inv_buf_size = lv_refr_get_buf_size(); /*Get the number of currently invalidated areas*/
lv_coord_t prev_x = drag_obj->coords.x1;
lv_coord_t prev_y = drag_obj->coords.y1;
lv_obj_set_pos(drag_obj, act_x + state->vect.x, act_y + state->vect.y);
/*Set the drag in progress flag if the object is really moved*/
if(lv_obj_get_x(drag_obj) != act_x || lv_obj_get_y(drag_obj) != act_y) {
if(drag_obj->coords.x1 != prev_x || drag_obj->coords.y1 != prev_y) {
if(state->drag_range_out != 0) { /*Send the drag begin signal on first move*/
drag_obj->signal_func(drag_obj, LV_SIGNAL_DRAG_BEGIN, indev_act);
if(state->reset_query != 0) return;

View File

@@ -284,20 +284,17 @@ lv_res_t lv_obj_del(lv_obj_t * obj)
lv_anim_del(obj, NULL);
#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
* the currently pressed object is deleted*/
lv_indev_t * indev = lv_indev_next(NULL);
lv_obj_t * dpar;
while(indev) {
dpar = obj;
while(dpar != NULL) {
if(indev->proc.act_obj == dpar ||
indev->proc.last_obj == dpar) {
lv_indev_reset(indev);
break;
} else {
dpar = lv_obj_get_parent(dpar);
}
if(indev->proc.act_obj == obj || indev->proc.last_obj == obj) {
lv_indev_reset(indev);
}
indev = lv_indev_next(indev);
}
@@ -1586,6 +1583,16 @@ static void delete_children(lv_obj_t * obj)
if(obj->group_p != NULL) lv_group_remove_obj(obj);
#endif
/* Reset the input devices if
* the currently pressed object is deleted*/
lv_indev_t * indev = lv_indev_next(NULL);
while(indev) {
if(indev->proc.act_obj == obj || indev->proc.last_obj == obj) {
lv_indev_reset(indev);
}
indev = lv_indev_next(indev);
}
/*Remove the object from parent's children list*/
lv_obj_t * par = lv_obj_get_parent(obj);
lv_ll_rem(&(par->child_ll), obj);

View File

@@ -429,7 +429,7 @@ void lv_obj_set_design_func(lv_obj_t * obj, lv_design_func_t fp);
* Allocate a new ext. data for an object
* @param obj pointer to an object
* @param ext_size the size of the new ext. data
* @return Normal pointer to the allocated ext
* @return pointer to the allocated ext
*/
void * lv_obj_allocate_ext_attr(lv_obj_t * obj, uint16_t ext_size);

View File

@@ -272,8 +272,11 @@ static void style_animator(lv_style_anim_dsc_t * dsc, int32_t val)
STYLE_ATTR_ANIM(body.padding.inner, val);
STYLE_ATTR_ANIM(text.line_space, val);
STYLE_ATTR_ANIM(text.letter_space, val);
STYLE_ATTR_ANIM(text.opa, val);
STYLE_ATTR_ANIM(line.width, val);
STYLE_ATTR_ANIM(line.opa, val);
STYLE_ATTR_ANIM(image.intense, val);
STYLE_ATTR_ANIM(image.opa, val);
lv_opa_t opa = val == LV_STYLE_ANIM_RES ? LV_OPA_COVER : val;