group: add user_data
This commit is contained in:
@@ -88,6 +88,7 @@ lv_obj_t * lv_btnm_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->action = NULL;
|
||||
ext->map_p = NULL;
|
||||
ext->toggle = 0;
|
||||
ext->recolor = 0;
|
||||
ext->styles_btn[LV_BTN_STATE_REL] = &lv_style_btn_rel;
|
||||
ext->styles_btn[LV_BTN_STATE_PR] = &lv_style_btn_pr;
|
||||
ext->styles_btn[LV_BTN_STATE_TGL_REL] = &lv_style_btn_tgl_rel;
|
||||
|
||||
@@ -74,7 +74,7 @@ lv_obj_t * lv_img_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
|
||||
ext->src = NULL;
|
||||
ext->src_type = LV_IMG_SRC_UNKNOWN;
|
||||
ext->cf = LV_IMG_CF_UNKOWN;
|
||||
ext->cf = LV_IMG_CF_UNKNOWN;
|
||||
ext->w = lv_obj_get_width(new_img);
|
||||
ext->h = lv_obj_get_height(new_img);
|
||||
ext->auto_size = 1;
|
||||
|
||||
@@ -69,7 +69,7 @@ lv_obj_t * lv_imgbtn_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
memset(ext->img_src_right, 0, sizeof(ext->img_src_right));
|
||||
#endif
|
||||
|
||||
ext->act_cf = LV_IMG_CF_UNKOWN;
|
||||
ext->act_cf = LV_IMG_CF_UNKNOWN;
|
||||
|
||||
/*The signal and design functions are not copied so set them here*/
|
||||
lv_obj_set_signal_cb(new_imgbtn, lv_imgbtn_signal);
|
||||
@@ -382,7 +382,7 @@ static void refr_img(lv_obj_t * imgbtn)
|
||||
lv_obj_set_height(imgbtn, header.h);
|
||||
#endif
|
||||
} else {
|
||||
ext->act_cf = LV_IMG_CF_UNKOWN;
|
||||
ext->act_cf = LV_IMG_CF_UNKNOWN;
|
||||
}
|
||||
|
||||
lv_obj_invalidate(imgbtn);
|
||||
|
||||
@@ -1208,6 +1208,7 @@ static lv_res_t lv_ta_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, void
|
||||
|
||||
lv_obj_t * ta = lv_obj_get_parent(scrl);
|
||||
lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta);
|
||||
|
||||
if(sign == LV_SIGNAL_REFR_EXT_SIZE) {
|
||||
/*Set ext. size because the cursor might be out of this object*/
|
||||
lv_style_t * style_label = lv_obj_get_style(ext->label);
|
||||
@@ -1219,6 +1220,9 @@ static lv_res_t lv_ta_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, void
|
||||
if(ext->label) {
|
||||
if(lv_obj_get_width(ta) != lv_area_get_width(param) ||
|
||||
lv_obj_get_height(ta) != lv_area_get_height(param)) {
|
||||
|
||||
lv_obj_t * scrl = lv_page_get_scrl(ta);
|
||||
|
||||
lv_style_t * style_scrl = lv_obj_get_style(scrl);
|
||||
lv_obj_set_width(ext->label, lv_obj_get_width(scrl) - 2 * style_scrl->body.padding.hor);
|
||||
lv_obj_set_pos(ext->label, style_scrl->body.padding.hor, style_scrl->body.padding.ver);
|
||||
@@ -1232,7 +1236,6 @@ static lv_res_t lv_ta_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, void
|
||||
update_cursor_position_on_click(ta, (lv_indev_t *)param);
|
||||
}
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -336,6 +336,8 @@ static lv_res_t lv_tileview_scrl_signal(lv_obj_t * scrl, lv_signal_t sign, void
|
||||
if(res != LV_RES_OK) return res;
|
||||
|
||||
lv_obj_t * tileview = lv_obj_get_parent(scrl);
|
||||
lv_style_t * style_bg = lv_tileview_get_style(tileview, LV_TILEVIEW_STYLE_BG);
|
||||
|
||||
|
||||
/*Apply constraint on moving of the tileview*/
|
||||
if(sign == LV_SIGNAL_CORD_CHG) {
|
||||
@@ -379,7 +381,7 @@ static lv_res_t lv_tileview_scrl_signal(lv_obj_t * scrl, lv_signal_t sign, void
|
||||
lv_page_start_edge_flash(tileview);
|
||||
}
|
||||
|
||||
lv_obj_set_y(scrl, -ext->act_id.y * h);
|
||||
lv_obj_set_y(scrl, -ext->act_id.y * h + style_bg->body.padding.ver);
|
||||
}
|
||||
}
|
||||
if(ext->drag_bottom_en == 0 && indev->proc.types.pointer.vect.y < 0 && ext->drag_hor == 0) {
|
||||
@@ -392,7 +394,7 @@ static lv_res_t lv_tileview_scrl_signal(lv_obj_t * scrl, lv_signal_t sign, void
|
||||
}
|
||||
}
|
||||
|
||||
lv_obj_set_y(scrl, -ext->act_id.y * h);
|
||||
lv_obj_set_y(scrl, -ext->act_id.y * h + style_bg->body.padding.ver);
|
||||
}
|
||||
if(ext->drag_left_en == 0) {
|
||||
if(x > -(ext->act_id.x * w) && indev->proc.types.pointer.vect.x > 0 && ext->drag_ver == 0) {
|
||||
@@ -403,7 +405,7 @@ static lv_res_t lv_tileview_scrl_signal(lv_obj_t * scrl, lv_signal_t sign, void
|
||||
lv_page_start_edge_flash(tileview);
|
||||
}
|
||||
|
||||
lv_obj_set_x(scrl, -ext->act_id.x * w);
|
||||
lv_obj_set_x(scrl, -ext->act_id.x * w + style_bg->body.padding.hor);
|
||||
}
|
||||
}
|
||||
if(ext->drag_right_en == 0 && indev->proc.types.pointer.vect.x < 0 && ext->drag_ver == 0) {
|
||||
@@ -416,12 +418,12 @@ static lv_res_t lv_tileview_scrl_signal(lv_obj_t * scrl, lv_signal_t sign, void
|
||||
}
|
||||
}
|
||||
|
||||
lv_obj_set_x(scrl, -ext->act_id.x * w);
|
||||
lv_obj_set_x(scrl, -ext->act_id.x * w + style_bg->body.padding.hor);
|
||||
}
|
||||
|
||||
/*Apply the drag constraints*/
|
||||
if(ext->drag_ver == 0) lv_obj_set_y(scrl, - ext->act_id.y * lv_obj_get_height(tileview));
|
||||
if(ext->drag_hor == 0) lv_obj_set_x(scrl, - ext->act_id.x * lv_obj_get_width(tileview));
|
||||
if(ext->drag_ver == 0) lv_obj_set_y(scrl, - ext->act_id.y * lv_obj_get_height(tileview) + style_bg->body.padding.ver);
|
||||
if(ext->drag_hor == 0) lv_obj_set_x(scrl, - ext->act_id.x * lv_obj_get_width(tileview) + style_bg->body.padding.hor);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user