marge master

This commit is contained in:
Gabor Kiss-Vamosi
2019-03-06 22:59:58 +01:00
6 changed files with 59 additions and 14 deletions

View File

@@ -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;

View File

@@ -1202,6 +1202,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);
@@ -1213,6 +1214,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);
@@ -1226,7 +1230,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;
}

View File

@@ -334,6 +334,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) {
@@ -377,7 +379,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) {
@@ -390,7 +392,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) {
@@ -401,7 +403,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) {
@@ -414,12 +416,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);
}
}