diff --git a/lv_obj/lv_obj.c b/lv_obj/lv_obj.c index 3ca0d2befa..d7ef16e970 100644 --- a/lv_obj/lv_obj.c +++ b/lv_obj/lv_obj.c @@ -956,7 +956,7 @@ void * lv_obj_alloc_ext(lv_obj_t * obj, uint16_t ext_size) * Send a 'LV_SIGNAL_REFR_EXT_SIZE' signal to the object * @param obj pointer to an object */ -void lv_obj_ext_size_refr(lv_obj_t * obj) +void lv_obj_refr_ext_size(lv_obj_t * obj) { obj->ext_size = 0; obj->signal_f(obj, LV_SIGNAL_REFR_EXT_SIZE, NULL); diff --git a/lv_obj/lv_obj.h b/lv_obj/lv_obj.h index be0e6f8696..400aa20cd0 100644 --- a/lv_obj/lv_obj.h +++ b/lv_obj/lv_obj.h @@ -197,7 +197,7 @@ void lv_obj_set_height(lv_obj_t * obj, cord_t h); void lv_obj_set_height_us(lv_obj_t * obj, cord_t h); void lv_obj_align(lv_obj_t * obj,lv_obj_t * base, lv_align_t align, cord_t x_mod, cord_t y_mod); void lv_obj_align_us(lv_obj_t * obj,lv_obj_t * base, lv_align_t align, cord_t x_mod, cord_t y_mod); -void lv_obj_set_ext_size(lv_obj_t * obj, cord_t ext_size);; +void lv_obj_set_ext_size(lv_obj_t * obj, cord_t ext_size); /*Appearance set*/ void lv_obj_set_hidden(lv_obj_t * obj, bool hidden_en); void lv_obj_set_opa(lv_obj_t * obj, opa_t opa); @@ -212,7 +212,7 @@ void lv_obj_set_signal_f(lv_obj_t * obj, lv_signal_f_t fp); void lv_obj_set_design_f(lv_obj_t * obj, lv_design_f_t fp); /*Other set*/ void * lv_obj_alloc_ext(lv_obj_t * obj, uint16_t ext_size); -void lv_obj_ext_size_refr(lv_obj_t * obj); +void lv_obj_refr_ext_size(lv_obj_t * obj); void lv_obj_set_style(lv_obj_t * obj, void * style_p); void * lv_obj_iso_style(lv_obj_t * obj, uint32_t style_size); void lv_obj_set_free_num(lv_obj_t * obj, uint8_t free_num); diff --git a/lv_objx/lv_img.c b/lv_objx/lv_img.c index be5ff26148..54fcb41fbd 100644 --- a/lv_objx/lv_img.c +++ b/lv_objx/lv_img.c @@ -165,7 +165,7 @@ fs_res_t lv_img_create_file(const char * fn, const color_int_t * data) { const lv_img_raw_header_t * raw_p = (lv_img_raw_header_t *) data; fs_res_t res; - res = ufs_create_const(fn, data, raw_p->w * raw_p->h * sizeof(color_t)); + res = ufs_create_const(fn, data, raw_p->w * raw_p->h * sizeof(color_t) + sizeof(lv_img_raw_header_t)); return res; } diff --git a/lv_objx/lv_list.c b/lv_objx/lv_list.c index d4851acadc..c08bb70b20 100644 --- a/lv_objx/lv_list.c +++ b/lv_objx/lv_list.c @@ -118,7 +118,7 @@ lv_obj_t * lv_list_add(lv_obj_t * list, const char * img_fn, const char * txt, b /*Create a list element with the image an the text*/ lv_obj_t * liste; liste = lv_btn_create(list, NULL); - lv_obj_set_style(liste, &lists->liste_btn); + lv_obj_set_style(liste, &lists->liste_btns); lv_btn_set_rel_action(liste, rel_action); lv_page_glue_obj(liste, true); lv_rect_set_layout(liste, lists->liste_layout); @@ -127,14 +127,14 @@ lv_obj_t * lv_list_add(lv_obj_t * list, const char * img_fn, const char * txt, b if(img_fn != NULL) { lv_obj_t * img = lv_img_create(liste, NULL); lv_img_set_file(img, img_fn); - lv_obj_set_style(img, &lists->liste_img); + lv_obj_set_style(img, &lists->liste_imgs); lv_obj_set_click(img, false); } if(txt != NULL) { lv_obj_t * label = lv_label_create(liste, NULL); lv_label_set_text(label, txt); - lv_obj_set_style(label,&lists->liste_label); + lv_obj_set_style(label,&lists->liste_labels); lv_obj_set_click(label, false); } @@ -143,8 +143,8 @@ lv_obj_t * lv_list_add(lv_obj_t * list, const char * img_fn, const char * txt, b /*Now the width will be adjusted*/ lv_rect_set_fit(liste, false, true); cord_t w = lv_obj_get_width(list); - w -= lists->bg_page.bg_rects.hpad * 2; - w -= lists->bg_page.scrable_rects.hpad * 2; + w -= lists->bg_pages.bg_rects.hpad * 2; + w -= lists->bg_pages.scrable_rects.hpad * 2; lv_obj_set_width(liste, w); } else if(ext->fit == LV_LIST_FIT_LONGEST) { /*In this case the width will be adjusted*/ @@ -322,32 +322,32 @@ static bool lv_list_design(lv_obj_t * list, const area_t * mask, lv_design_mode_ static void lv_lists_init(void) { /*Default style*/ - lv_pages_get(LV_PAGES_TRANSP, &lv_lists_def.bg_page); - lv_lists_def.bg_page.bg_rects.vpad = 0 * LV_STYLE_MULT; - lv_lists_def.bg_page.bg_rects.hpad = 0 * LV_STYLE_MULT; - lv_lists_def.bg_page.bg_rects.opad = 0 * LV_STYLE_MULT; + lv_pages_get(LV_PAGES_TRANSP, &lv_lists_def.bg_pages); + lv_lists_def.bg_pages.bg_rects.vpad = 0 * LV_STYLE_MULT; + lv_lists_def.bg_pages.bg_rects.hpad = 0 * LV_STYLE_MULT; + lv_lists_def.bg_pages.bg_rects.opad = 0 * LV_STYLE_MULT; - lv_lists_def.bg_page.scrable_rects.vpad = 10 * LV_STYLE_MULT; - lv_lists_def.bg_page.scrable_rects.hpad = 10 * LV_STYLE_MULT; - lv_lists_def.bg_page.scrable_rects.opad = 5 * LV_STYLE_MULT; + lv_lists_def.bg_pages.scrable_rects.vpad = 10 * LV_STYLE_MULT; + lv_lists_def.bg_pages.scrable_rects.hpad = 10 * LV_STYLE_MULT; + lv_lists_def.bg_pages.scrable_rects.opad = 5 * LV_STYLE_MULT; - lv_btns_get(LV_BTNS_DEF, &lv_lists_def.liste_btn); /*List element button style*/ + lv_btns_get(LV_BTNS_DEF, &lv_lists_def.liste_btns); /*List element button style*/ - lv_labels_get(LV_LABELS_BTN, &lv_lists_def.liste_label); /*List element label style*/ - lv_lists_def.liste_label.mid = 0; + lv_labels_get(LV_LABELS_BTN, &lv_lists_def.liste_labels); /*List element label style*/ + lv_lists_def.liste_labels.mid = 0; - lv_imgs_get(LV_IMGS_DEF, &lv_lists_def.liste_img); /*Lit element image style*/ + lv_imgs_get(LV_IMGS_DEF, &lv_lists_def.liste_imgs); /*Lit element image style*/ lv_lists_def.liste_layout = LV_RECT_LAYOUT_ROW_M; memcpy(&lv_lists_tight, &lv_lists_def, sizeof(lv_lists_t)); - lv_lists_tight.bg_page.bg_rects.vpad = 0 * LV_STYLE_MULT; - lv_lists_tight.bg_page.bg_rects.hpad = 0 * LV_STYLE_MULT; - lv_lists_tight.bg_page.bg_rects.opad = 0 * LV_STYLE_MULT; + lv_lists_tight.bg_pages.bg_rects.vpad = 0 * LV_STYLE_MULT; + lv_lists_tight.bg_pages.bg_rects.hpad = 0 * LV_STYLE_MULT; + lv_lists_tight.bg_pages.bg_rects.opad = 0 * LV_STYLE_MULT; - lv_lists_tight.bg_page.scrable_rects.vpad = 0 * LV_STYLE_MULT; - lv_lists_tight.bg_page.scrable_rects.hpad = 0 * LV_STYLE_MULT; - lv_lists_tight.bg_page.scrable_rects.opad = 0 * LV_STYLE_MULT; + lv_lists_tight.bg_pages.scrable_rects.vpad = 0 * LV_STYLE_MULT; + lv_lists_tight.bg_pages.scrable_rects.hpad = 0 * LV_STYLE_MULT; + lv_lists_tight.bg_pages.scrable_rects.opad = 0 * LV_STYLE_MULT; } #endif diff --git a/lv_objx/lv_list.h b/lv_objx/lv_list.h index 2050258f1f..d9ee263011 100644 --- a/lv_objx/lv_list.h +++ b/lv_objx/lv_list.h @@ -29,11 +29,11 @@ /*Style of list*/ typedef struct { - lv_pages_t bg_page; /*Style of ancestor*/ + lv_pages_t bg_pages; /*Style of ancestor*/ /*New style element for this type */ - lv_btns_t liste_btn; - lv_labels_t liste_label; - lv_imgs_t liste_img; + lv_btns_t liste_btns; + lv_labels_t liste_labels; + lv_imgs_t liste_imgs; lv_rect_layout_t liste_layout; }lv_lists_t; diff --git a/lv_objx/lv_page.c b/lv_objx/lv_page.c index 577c9dc07e..5829ad43b4 100644 --- a/lv_objx/lv_page.c +++ b/lv_objx/lv_page.c @@ -350,6 +350,8 @@ static bool lv_page_design(lv_obj_t * page, const area_t * mask, lv_design_mode_ } else if(mode == LV_DESIGN_DRAW_MAIN) { ancestor_design_f(page, mask, mode); } else if(mode == LV_DESIGN_DRAW_POST) { /*Draw the scroll bars finally*/ + ancestor_design_f(page, mask, mode); + lv_page_ext_t * ext = lv_obj_get_ext(page); lv_pages_t * style = lv_obj_get_style(page); opa_t sb_opa = lv_obj_get_opa(page) * style->sb_opa /100; diff --git a/lv_objx/lv_rect.c b/lv_objx/lv_rect.c index e7692572de..bb29f48af6 100644 --- a/lv_objx/lv_rect.c +++ b/lv_objx/lv_rect.c @@ -120,7 +120,7 @@ bool lv_rect_signal(lv_obj_t * rect, lv_signal_t sign, void * param) case LV_SIGNAL_STYLE_CHG: /*Recalculate the padding if the style changed*/ lv_rect_refr_layout(rect); lv_rect_refr_autofit(rect); - lv_obj_ext_size_refr(rect); + lv_obj_refr_ext_size(rect); break; case LV_SIGNAL_CHILD_CHG: lv_rect_refr_layout(rect);