refactor(btn, img): rename btn to button and img to image
This commit is contained in:
@@ -6,13 +6,13 @@
|
||||
*/
|
||||
void lv_example_bar_4(void)
|
||||
{
|
||||
LV_IMG_DECLARE(img_skew_strip);
|
||||
LV_IMAGE_DECLARE(img_skew_strip);
|
||||
static lv_style_t style_indic;
|
||||
|
||||
lv_style_init(&style_indic);
|
||||
lv_style_set_bg_img_src(&style_indic, &img_skew_strip);
|
||||
lv_style_set_bg_img_tiled(&style_indic, true);
|
||||
lv_style_set_bg_img_opa(&style_indic, LV_OPA_30);
|
||||
lv_style_set_bg_image_src(&style_indic, &img_skew_strip);
|
||||
lv_style_set_bg_image_tiled(&style_indic, true);
|
||||
lv_style_set_bg_image_opa(&style_indic, LV_OPA_30);
|
||||
|
||||
lv_obj_t * bar = lv_bar_create(lv_scr_act());
|
||||
lv_obj_add_style(bar, &style_indic, LV_PART_INDICATOR);
|
||||
|
||||
@@ -6,7 +6,7 @@ except:
|
||||
print("Could not find img_strip.png")
|
||||
sys.exit()
|
||||
|
||||
img_skew_strip_dsc = lv.img_dsc_t({
|
||||
image_skew_strip_dsc = lv.image_dsc_t({
|
||||
'data_size': len(png_data),
|
||||
'data': png_data
|
||||
})
|
||||
@@ -18,9 +18,9 @@ img_skew_strip_dsc = lv.img_dsc_t({
|
||||
style_indic = lv.style_t()
|
||||
|
||||
style_indic.init()
|
||||
style_indic.set_bg_img_src(img_skew_strip_dsc)
|
||||
style_indic.set_bg_img_tiled(True)
|
||||
style_indic.set_bg_img_opa(lv.OPA._30)
|
||||
style_indic.set_bg_image_src(image_skew_strip_dsc)
|
||||
style_indic.set_bg_image_tiled(True)
|
||||
style_indic.set_bg_image_opa(lv.OPA._30)
|
||||
|
||||
bar = lv.bar(lv.scr_act())
|
||||
bar.add_style(style_indic, lv.PART.INDICATOR)
|
||||
|
||||
Reference in New Issue
Block a user