BigW Consortium Gitlab

Commit 6f1d63bf by Kiss-Vamosi Gabor

LV_CONT_LAYOUT_PRETTY with LV_PROTECT_FOLLOW bugfix

parent ca3f4e1a
......@@ -438,7 +438,14 @@ static void lv_cont_layout_pretty(lv_obj_t * cont)
do {
if(lv_obj_get_hidden(child_rc) == false &&
lv_obj_is_protected(child_rc, LV_PROTECT_POS) == false) {
if(w_row + lv_obj_get_width(child_rc) > w_obj) break; /*If this object is already not fit then break*/
/*If this object is already not fit then break*/
if(w_row + lv_obj_get_width(child_rc) > w_obj) {
/*Step back one child because the last already not fit, so the previous is the closer*/
if(child_rc != NULL && obj_num != 0 ) {
child_rc = ll_get_next(&cont->child_ll, child_rc);
}
break;
}
w_row += lv_obj_get_width(child_rc) + style->opad; /*Add the object width + opad*/
h_row = MATH_MAX(h_row, lv_obj_get_height(child_rc)); /*Search the highest object*/
obj_num ++;
......@@ -449,11 +456,6 @@ static void lv_cont_layout_pretty(lv_obj_t * cont)
if(obj_num == 0) child_rs = child_rc; /*If the first object was hidden (or too long) then set the next as first */
}while(child_rc != NULL);
/*Step back one child because the last already not fit (except follow protected)*/
if(child_rc != NULL && obj_num != 0 && !lv_obj_is_protected(child_rc, LV_PROTECT_FOLLOW)) {
child_rc = ll_get_next(&cont->child_ll, child_rc);
}
/*If the object is too long then align it to the middle*/
if(obj_num == 0) {
if(child_rc != NULL) {
......
......@@ -108,10 +108,6 @@ lv_obj_t * lv_win_create(lv_obj_t * par, lv_obj_t * copy)
lv_win_ext_t * copy_ext = lv_obj_get_ext(copy);
/*Create the objects*/
ext->header = lv_cont_create(new_win, copy_ext->header);
/*Move back the header because it is automatically moved to the scrollable */
lv_obj_set_protect(ext->header, LV_PROTECT_PARENT);
lv_obj_set_parent(ext->header, new_win);
ext->title = lv_label_create(ext->header, copy_ext->title);
ext->btnh = lv_cont_create(ext->header, copy_ext->btnh);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment