refactor(style): rename shadow_ofs to shadow_offset
This commit is contained in:
@@ -48,8 +48,8 @@ static void fw_update_btn_clicked_event_cb(lv_event_t * e)
|
||||
lv_obj_set_height(lv_win_get_header(win), 40);
|
||||
lv_obj_set_style_radius(win, 8, 0);
|
||||
lv_obj_set_style_shadow_width(win, 24, 0);
|
||||
lv_obj_set_style_shadow_ofs_x(win, 2, 0);
|
||||
lv_obj_set_style_shadow_ofs_y(win, 3, 0);
|
||||
lv_obj_set_style_shadow_offset_x(win, 2, 0);
|
||||
lv_obj_set_style_shadow_offset_y(win, 3, 0);
|
||||
lv_obj_set_style_shadow_color(win, lv_color_hex3(0x888), 0);
|
||||
lv_win_add_title(win, "Firmware update");
|
||||
lv_obj_t * btn = lv_win_add_button(win, LV_SYMBOL_CLOSE, 40);
|
||||
|
||||
@@ -93,8 +93,8 @@ static lv_obj_t * my_panel_create(lv_obj_t * parent)
|
||||
lv_style_set_radius(&styles.style_main, 12);
|
||||
lv_style_set_bg_opa(&styles.style_main, LV_OPA_COVER);
|
||||
lv_style_set_shadow_width(&styles.style_main, 24);
|
||||
lv_style_set_shadow_ofs_x(&styles.style_main, 4);
|
||||
lv_style_set_shadow_ofs_y(&styles.style_main, 6);
|
||||
lv_style_set_shadow_offset_x(&styles.style_main, 4);
|
||||
lv_style_set_shadow_offset_y(&styles.style_main, 6);
|
||||
lv_style_set_pad_all(&styles.style_main, 12);
|
||||
lv_style_set_pad_gap(&styles.style_main, 16);
|
||||
|
||||
@@ -168,7 +168,7 @@ static lv_obj_t * my_button_create(lv_obj_t * parent, const char * text, lv_even
|
||||
lv_style_set_bg_opa(&styles.style_main, LV_OPA_COVER);
|
||||
lv_style_set_bg_grad_dir(&styles.style_main, LV_GRAD_DIR_HOR);
|
||||
lv_style_set_shadow_width(&styles.style_main, 24);
|
||||
lv_style_set_shadow_ofs_y(&styles.style_main, 6);
|
||||
lv_style_set_shadow_offset_y(&styles.style_main, 6);
|
||||
lv_style_set_pad_hor(&styles.style_main, 32);
|
||||
lv_style_set_pad_ver(&styles.style_main, 12);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ void lv_example_style_11(void)
|
||||
lv_style_set_border_width(&style_base, 2);
|
||||
lv_style_set_radius(&style_base, 10);
|
||||
lv_style_set_shadow_width(&style_base, 10);
|
||||
lv_style_set_shadow_ofs_y(&style_base, 5);
|
||||
lv_style_set_shadow_offset_y(&style_base, 5);
|
||||
lv_style_set_shadow_opa(&style_base, LV_OPA_50);
|
||||
lv_style_set_text_color(&style_base, lv_color_white());
|
||||
lv_style_set_width(&style_base, 100);
|
||||
|
||||
@@ -10,7 +10,7 @@ style_base.set_border_color(lv.palette_darken(lv.PALETTE.LIGHT_BLUE, 3))
|
||||
style_base.set_border_width(2)
|
||||
style_base.set_radius(10)
|
||||
style_base.set_shadow_width(10)
|
||||
style_base.set_shadow_ofs_y(5)
|
||||
style_base.set_shadow_offset_y(5)
|
||||
style_base.set_shadow_opa(lv.OPA._50)
|
||||
style_base.set_text_color(lv.color_white())
|
||||
style_base.set_width(100)
|
||||
|
||||
@@ -13,8 +13,8 @@ style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 1))
|
||||
# Add a shadow
|
||||
style.set_shadow_width(8)
|
||||
style.set_shadow_color(lv.palette_main(lv.PALETTE.BLUE))
|
||||
style.set_shadow_ofs_x(10)
|
||||
style.set_shadow_ofs_y(20)
|
||||
style.set_shadow_offset_x(10)
|
||||
style.set_shadow_offset_y(20)
|
||||
|
||||
# Create an object with the new style
|
||||
obj = lv.obj(lv.screen_active())
|
||||
|
||||
@@ -23,7 +23,7 @@ void lv_example_button_2(void)
|
||||
|
||||
lv_style_set_shadow_width(&style, 8);
|
||||
lv_style_set_shadow_color(&style, lv_palette_main(LV_PALETTE_GREY));
|
||||
lv_style_set_shadow_ofs_y(&style, 8);
|
||||
lv_style_set_shadow_offset_y(&style, 8);
|
||||
|
||||
lv_style_set_outline_opa(&style, LV_OPA_COVER);
|
||||
lv_style_set_outline_color(&style, lv_palette_main(LV_PALETTE_BLUE));
|
||||
@@ -40,7 +40,7 @@ void lv_example_button_2(void)
|
||||
lv_style_set_outline_opa(&style_pr, LV_OPA_TRANSP);
|
||||
|
||||
lv_style_set_translate_y(&style_pr, 5);
|
||||
lv_style_set_shadow_ofs_y(&style_pr, 3);
|
||||
lv_style_set_shadow_offset_y(&style_pr, 3);
|
||||
lv_style_set_bg_color(&style_pr, lv_palette_darken(LV_PALETTE_BLUE, 2));
|
||||
lv_style_set_bg_grad_color(&style_pr, lv_palette_darken(LV_PALETTE_BLUE, 4));
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ style.set_border_color(lv.palette_main(lv.PALETTE.GREY))
|
||||
|
||||
style.set_shadow_width(8)
|
||||
style.set_shadow_color(lv.palette_main(lv.PALETTE.GREY))
|
||||
style.set_shadow_ofs_y(8)
|
||||
style.set_shadow_offset_y(8)
|
||||
|
||||
style.set_outline_opa(lv.OPA.COVER)
|
||||
style.set_outline_color(lv.palette_main(lv.PALETTE.BLUE))
|
||||
@@ -36,7 +36,7 @@ style_pr.set_outline_width(30)
|
||||
style_pr.set_outline_opa(lv.OPA.TRANSP)
|
||||
|
||||
style_pr.set_translate_y(5)
|
||||
style_pr.set_shadow_ofs_y(3)
|
||||
style_pr.set_shadow_offset_y(3)
|
||||
style_pr.set_bg_color(lv.palette_darken(lv.PALETTE.BLUE, 2))
|
||||
style_pr.set_bg_grad_color(lv.palette_darken(lv.PALETTE.BLUE, 4))
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ static void event_cb(lv_event_t * e)
|
||||
if(pressed) rect_draw_dsc->bg_color = lv_palette_darken(LV_PALETTE_BLUE, 3);
|
||||
else rect_draw_dsc->bg_color = lv_palette_main(LV_PALETTE_BLUE);
|
||||
rect_draw_dsc->shadow_width = 6;
|
||||
rect_draw_dsc->shadow_ofs_x = 3;
|
||||
rect_draw_dsc->shadow_ofs_y = 3;
|
||||
rect_draw_dsc->shadow_offset_x = 3;
|
||||
rect_draw_dsc->shadow_offset_y = 3;
|
||||
}
|
||||
if(draw_task->type == LV_DRAW_TASK_TYPE_LABEL) {
|
||||
lv_draw_label_dsc_t * label_draw_dsc = draw_task->draw_dsc;
|
||||
|
||||
@@ -20,8 +20,8 @@ void lv_example_canvas_1(void)
|
||||
rect_dsc.border_opa = LV_OPA_90;
|
||||
rect_dsc.border_color = lv_color_white();
|
||||
rect_dsc.shadow_width = 5;
|
||||
rect_dsc.shadow_ofs_x = 5;
|
||||
rect_dsc.shadow_ofs_y = 5;
|
||||
rect_dsc.shadow_offset_x = 5;
|
||||
rect_dsc.shadow_offset_y = 5;
|
||||
|
||||
lv_draw_label_dsc_t label_dsc;
|
||||
lv_draw_label_dsc_init(&label_dsc);
|
||||
|
||||
@@ -17,8 +17,8 @@ rect_dsc.border_width = 2
|
||||
rect_dsc.border_opa = lv.OPA._90
|
||||
rect_dsc.border_color = lv.color_white()
|
||||
rect_dsc.shadow_width = 5
|
||||
rect_dsc.shadow_ofs_x = 5
|
||||
rect_dsc.shadow_ofs_y = 5
|
||||
rect_dsc.shadow_offset_x = 5
|
||||
rect_dsc.shadow_offset_y = 5
|
||||
|
||||
label_dsc = lv.draw_label_dsc_t()
|
||||
label_dsc.init()
|
||||
|
||||
Reference in New Issue
Block a user