refactor(style): rename shadow_ofs to shadow_offset
This commit is contained in:
@@ -68,7 +68,7 @@ void view_create(lv_obj_t * par, view_t * ui)
|
||||
lv_obj_set_style_border_width(obj, 0, 0);
|
||||
lv_obj_set_style_shadow_color(obj, lv_color_hex3(0xaaa), 0);
|
||||
lv_obj_set_style_shadow_width(obj, 20, 0);
|
||||
lv_obj_set_style_shadow_ofs_y(obj, 2, 0);
|
||||
lv_obj_set_style_shadow_offset_y(obj, 2, 0);
|
||||
lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
|
||||
lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(
|
||||
|
||||
@@ -185,7 +185,7 @@ void lv_demo_multilang(void)
|
||||
lv_style_set_grid_column_dsc_array(&style_card, grid_cols);
|
||||
lv_style_set_grid_row_dsc_array(&style_card, grid_rows);
|
||||
lv_style_set_shadow_width(&style_card, 20);
|
||||
lv_style_set_shadow_ofs_y(&style_card, 5);
|
||||
lv_style_set_shadow_offset_y(&style_card, 5);
|
||||
lv_style_set_shadow_color(&style_card, lv_color_hex3(0xccc));
|
||||
lv_style_set_border_width(&style_card, 0);
|
||||
lv_style_set_radius(&style_card, 12);
|
||||
@@ -209,7 +209,7 @@ void lv_demo_multilang(void)
|
||||
|
||||
lv_style_init(&style_avatar);
|
||||
lv_style_set_shadow_width(&style_avatar, 20);
|
||||
lv_style_set_shadow_ofs_y(&style_avatar, 5);
|
||||
lv_style_set_shadow_offset_y(&style_avatar, 5);
|
||||
lv_style_set_shadow_color(&style_avatar, lv_color_hex3(0xbbb));
|
||||
lv_style_set_radius(&style_avatar, LV_RADIUS_CIRCLE);
|
||||
|
||||
|
||||
@@ -244,24 +244,24 @@ static void box_shadow_cb(lv_obj_t * parent)
|
||||
lv_obj_t * obj = box_shadow_obj_create(parent, i, 0);
|
||||
lv_obj_set_style_radius(obj, 0, 0);
|
||||
lv_obj_set_style_shadow_width(obj, 10, 0);
|
||||
lv_obj_set_style_shadow_ofs_x(obj, ofs[i].x, 0);
|
||||
lv_obj_set_style_shadow_ofs_y(obj, ofs[i].y, 0);
|
||||
lv_obj_set_style_shadow_offset_x(obj, ofs[i].x, 0);
|
||||
lv_obj_set_style_shadow_offset_y(obj, ofs[i].y, 0);
|
||||
}
|
||||
|
||||
for(i = 0; i < 7; i++) {
|
||||
lv_obj_t * obj = box_shadow_obj_create(parent, i, 1);
|
||||
lv_obj_set_style_radius(obj, 5, 0);
|
||||
lv_obj_set_style_shadow_width(obj, 10, 0);
|
||||
lv_obj_set_style_shadow_ofs_x(obj, ofs[i].x, 0);
|
||||
lv_obj_set_style_shadow_ofs_y(obj, ofs[i].y, 0);
|
||||
lv_obj_set_style_shadow_offset_x(obj, ofs[i].x, 0);
|
||||
lv_obj_set_style_shadow_offset_y(obj, ofs[i].y, 0);
|
||||
}
|
||||
|
||||
for(i = 0; i < 7; i++) {
|
||||
lv_obj_t * obj = box_shadow_obj_create(parent, i, 2);
|
||||
lv_obj_set_style_radius(obj, 100, 0);
|
||||
lv_obj_set_style_shadow_width(obj, 10, 0);
|
||||
lv_obj_set_style_shadow_ofs_x(obj, ofs[i].x, 0);
|
||||
lv_obj_set_style_shadow_ofs_y(obj, ofs[i].y, 0);
|
||||
lv_obj_set_style_shadow_offset_x(obj, ofs[i].x, 0);
|
||||
lv_obj_set_style_shadow_offset_y(obj, ofs[i].y, 0);
|
||||
}
|
||||
|
||||
for(i = 0; i < 7; i++) {
|
||||
@@ -269,8 +269,8 @@ static void box_shadow_cb(lv_obj_t * parent)
|
||||
lv_obj_set_style_radius(obj, 5, 0);
|
||||
lv_obj_set_style_shadow_width(obj, 10, 0);
|
||||
lv_obj_set_style_shadow_spread(obj, 3, 0);
|
||||
lv_obj_set_style_shadow_ofs_x(obj, ofs[i].x, 0);
|
||||
lv_obj_set_style_shadow_ofs_y(obj, ofs[i].y, 0);
|
||||
lv_obj_set_style_shadow_offset_x(obj, ofs[i].x, 0);
|
||||
lv_obj_set_style_shadow_offset_y(obj, ofs[i].y, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ void lv_demo_scroll(void)
|
||||
{
|
||||
lv_obj_t * panel = lv_obj_create(lv_screen_active());
|
||||
lv_obj_set_style_shadow_width(panel, 16, 0);
|
||||
lv_obj_set_style_shadow_ofs_y(panel, 8, 0);
|
||||
lv_obj_set_style_shadow_ofs_x(panel, 4, 0);
|
||||
lv_obj_set_style_shadow_offset_y(panel, 8, 0);
|
||||
lv_obj_set_style_shadow_offset_x(panel, 4, 0);
|
||||
lv_obj_set_style_shadow_opa(panel, LV_OPA_40, 0);
|
||||
|
||||
lv_obj_set_size(panel, lv_pct(70), lv_pct(90));
|
||||
|
||||
@@ -58,7 +58,7 @@ void lv_demo_transform(void)
|
||||
lv_style_set_grid_column_dsc_array(&style_card, grid_cols);
|
||||
lv_style_set_grid_row_dsc_array(&style_card, grid_rows);
|
||||
lv_style_set_shadow_width(&style_card, 20);
|
||||
lv_style_set_shadow_ofs_y(&style_card, 5);
|
||||
lv_style_set_shadow_offset_y(&style_card, 5);
|
||||
lv_style_set_shadow_color(&style_card, lv_color_hex3(0xccc));
|
||||
lv_style_set_border_width(&style_card, 0);
|
||||
lv_style_set_radius(&style_card, 12);
|
||||
@@ -66,7 +66,7 @@ void lv_demo_transform(void)
|
||||
|
||||
lv_style_init(&style_avatar);
|
||||
lv_style_set_shadow_width(&style_avatar, 20);
|
||||
lv_style_set_shadow_ofs_y(&style_avatar, 5);
|
||||
lv_style_set_shadow_offset_y(&style_avatar, 5);
|
||||
lv_style_set_shadow_color(&style_avatar, lv_color_hex3(0xbbb));
|
||||
lv_style_set_radius(&style_avatar, LV_RADIUS_CIRCLE);
|
||||
|
||||
|
||||
@@ -489,7 +489,7 @@ Set the width of the shadow in pixels. The value should be >= 0.
|
||||
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Ext. draw</strong> Yes</li>
|
||||
</ul>
|
||||
|
||||
### shadow_ofs_x
|
||||
### shadow_offset_x
|
||||
Set an offset on the shadow in pixels in X direction.
|
||||
<ul>
|
||||
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Default</strong> 0</li>
|
||||
@@ -498,7 +498,7 @@ Set an offset on the shadow in pixels in X direction.
|
||||
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Ext. draw</strong> Yes</li>
|
||||
</ul>
|
||||
|
||||
### shadow_ofs_y
|
||||
### shadow_offset_y
|
||||
Set an offset on the shadow in pixels in Y direction.
|
||||
<ul>
|
||||
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Default</strong> 0</li>
|
||||
|
||||
@@ -2794,7 +2794,7 @@ Ext. draw Yes
|
||||
|
||||
</ul>
|
||||
|
||||
shadow_ofs_x
|
||||
shadow_offset_x
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Set an offset on the shadow in pixels in X direction.
|
||||
@@ -2847,7 +2847,7 @@ Ext. draw Yes
|
||||
|
||||
</ul>
|
||||
|
||||
shadow_ofs_y
|
||||
shadow_offset_y
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Set an offset on the shadow in pixels in Y direction.
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -220,11 +220,11 @@ props = [
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
|
||||
'dsc': "Set the width of the shadow in pixels. The value should be >= 0."},
|
||||
|
||||
{'name': 'SHADOW_OFS_X',
|
||||
{'name': 'SHADOW_OFFSET_X',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
|
||||
'dsc': "Set an offset on the shadow in pixels in X direction. "},
|
||||
|
||||
{'name': 'SHADOW_OFS_Y',
|
||||
{'name': 'SHADOW_OFFSET_Y',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
|
||||
'dsc': "Set an offset on the shadow in pixels in Y direction. "},
|
||||
|
||||
|
||||
@@ -124,8 +124,8 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint32_t part, lv_draw_rect_dsc_t
|
||||
if(draw_dsc->shadow_opa > LV_OPA_MIN) {
|
||||
draw_dsc->shadow_opa = lv_obj_get_style_shadow_opa(obj, part);
|
||||
if(draw_dsc->shadow_opa > LV_OPA_MIN) {
|
||||
draw_dsc->shadow_ofs_x = lv_obj_get_style_shadow_ofs_x(obj, part);
|
||||
draw_dsc->shadow_ofs_y = lv_obj_get_style_shadow_ofs_y(obj, part);
|
||||
draw_dsc->shadow_offset_x = lv_obj_get_style_shadow_offset_x(obj, part);
|
||||
draw_dsc->shadow_offset_y = lv_obj_get_style_shadow_offset_y(obj, part);
|
||||
draw_dsc->shadow_spread = lv_obj_get_style_shadow_spread(obj, part);
|
||||
draw_dsc->shadow_color = lv_obj_get_style_shadow_color_filtered(obj, part);
|
||||
}
|
||||
@@ -260,8 +260,8 @@ lv_coord_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, uint32_t part)
|
||||
if(sh_opa > LV_OPA_MIN) {
|
||||
sh_width = sh_width / 2 + 1; /*The blur adds only half width*/
|
||||
sh_width += lv_obj_get_style_shadow_spread(obj, part);
|
||||
lv_coord_t sh_ofs_x = lv_obj_get_style_shadow_ofs_x(obj, part);
|
||||
lv_coord_t sh_ofs_y = lv_obj_get_style_shadow_ofs_y(obj, part);
|
||||
lv_coord_t sh_ofs_x = lv_obj_get_style_shadow_offset_x(obj, part);
|
||||
lv_coord_t sh_ofs_y = lv_obj_get_style_shadow_offset_y(obj, part);
|
||||
sh_width += LV_MAX(LV_ABS(sh_ofs_x), LV_ABS(sh_ofs_y));
|
||||
s = LV_MAX(s, sh_width);
|
||||
}
|
||||
|
||||
@@ -625,8 +625,8 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t sta
|
||||
else if(lv_style_get_prop(style, LV_STYLE_OUTLINE_WIDTH, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_SHADOW_WIDTH, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_SHADOW_OPA, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_SHADOW_OFS_X, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_SHADOW_OFS_Y, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_SHADOW_OFFSET_X, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_SHADOW_OFFSET_Y, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_SHADOW_SPREAD, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(lv_style_get_prop(style, LV_STYLE_LINE_WIDTH, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
|
||||
else if(res == _LV_STYLE_STATE_CMP_SAME) res = _LV_STYLE_STATE_CMP_DIFF_REDRAW;
|
||||
|
||||
@@ -426,20 +426,20 @@ void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, lv_coord_t value, lv_
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_WIDTH, v, selector);
|
||||
}
|
||||
|
||||
void lv_obj_set_style_shadow_ofs_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
void lv_obj_set_style_shadow_offset_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFS_X, v, selector);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFFSET_X, v, selector);
|
||||
}
|
||||
|
||||
void lv_obj_set_style_shadow_ofs_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
void lv_obj_set_style_shadow_offset_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFS_Y, v, selector);
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFFSET_Y, v, selector);
|
||||
}
|
||||
|
||||
void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
|
||||
@@ -666,7 +666,8 @@ void lv_obj_set_style_opa_layered(struct _lv_obj_t * obj, lv_opa_t value, lv_sty
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_OPA_LAYERED, v, selector);
|
||||
}
|
||||
|
||||
void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector)
|
||||
void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value,
|
||||
lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.ptr = value
|
||||
@@ -706,7 +707,8 @@ void lv_obj_set_style_anim_speed(struct _lv_obj_t * obj, uint32_t value, lv_styl
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM_SPEED, v, selector);
|
||||
}
|
||||
|
||||
void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector)
|
||||
void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value,
|
||||
lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.ptr = value
|
||||
@@ -778,7 +780,8 @@ void lv_obj_set_style_flex_grow(struct _lv_obj_t * obj, uint8_t value, lv_style_
|
||||
lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_GROW, v, selector);
|
||||
}
|
||||
|
||||
void lv_obj_set_style_grid_column_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value, lv_style_selector_t selector)
|
||||
void lv_obj_set_style_grid_column_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value,
|
||||
lv_style_selector_t selector)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.ptr = value
|
||||
|
||||
@@ -208,7 +208,8 @@ static inline lv_color_t lv_obj_get_style_bg_grad_color(const struct _lv_obj_t *
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_bg_grad_color_filtered(const struct _lv_obj_t * obj, uint32_t part)
|
||||
{
|
||||
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_COLOR));
|
||||
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
|
||||
LV_STYLE_BG_GRAD_COLOR));
|
||||
return v.color;
|
||||
}
|
||||
|
||||
@@ -268,7 +269,8 @@ static inline lv_color_t lv_obj_get_style_bg_image_recolor(const struct _lv_obj_
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_bg_image_recolor_filtered(const struct _lv_obj_t * obj, uint32_t part)
|
||||
{
|
||||
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMAGE_RECOLOR));
|
||||
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
|
||||
LV_STYLE_BG_IMAGE_RECOLOR));
|
||||
return v.color;
|
||||
}
|
||||
|
||||
@@ -292,7 +294,8 @@ static inline lv_color_t lv_obj_get_style_border_color(const struct _lv_obj_t *
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_border_color_filtered(const struct _lv_obj_t * obj, uint32_t part)
|
||||
{
|
||||
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_COLOR));
|
||||
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
|
||||
LV_STYLE_BORDER_COLOR));
|
||||
return v.color;
|
||||
}
|
||||
|
||||
@@ -334,7 +337,8 @@ static inline lv_color_t lv_obj_get_style_outline_color(const struct _lv_obj_t *
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_outline_color_filtered(const struct _lv_obj_t * obj, uint32_t part)
|
||||
{
|
||||
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_COLOR));
|
||||
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
|
||||
LV_STYLE_OUTLINE_COLOR));
|
||||
return v.color;
|
||||
}
|
||||
|
||||
@@ -356,15 +360,15 @@ static inline lv_coord_t lv_obj_get_style_shadow_width(const struct _lv_obj_t *
|
||||
return (lv_coord_t)v.num;
|
||||
}
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_shadow_ofs_x(const struct _lv_obj_t * obj, uint32_t part)
|
||||
static inline lv_coord_t lv_obj_get_style_shadow_offset_x(const struct _lv_obj_t * obj, uint32_t part)
|
||||
{
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFS_X);
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFFSET_X);
|
||||
return (lv_coord_t)v.num;
|
||||
}
|
||||
|
||||
static inline lv_coord_t lv_obj_get_style_shadow_ofs_y(const struct _lv_obj_t * obj, uint32_t part)
|
||||
static inline lv_coord_t lv_obj_get_style_shadow_offset_y(const struct _lv_obj_t * obj, uint32_t part)
|
||||
{
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFS_Y);
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFFSET_Y);
|
||||
return (lv_coord_t)v.num;
|
||||
}
|
||||
|
||||
@@ -382,7 +386,8 @@ static inline lv_color_t lv_obj_get_style_shadow_color(const struct _lv_obj_t *
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_shadow_color_filtered(const struct _lv_obj_t * obj, uint32_t part)
|
||||
{
|
||||
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_COLOR));
|
||||
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
|
||||
LV_STYLE_SHADOW_COLOR));
|
||||
return v.color;
|
||||
}
|
||||
|
||||
@@ -406,7 +411,8 @@ static inline lv_color_t lv_obj_get_style_image_recolor(const struct _lv_obj_t *
|
||||
|
||||
static inline lv_color_t lv_obj_get_style_image_recolor_filtered(const struct _lv_obj_t * obj, uint32_t part)
|
||||
{
|
||||
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_IMAGE_RECOLOR));
|
||||
lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
|
||||
LV_STYLE_IMAGE_RECOLOR));
|
||||
return v.color;
|
||||
}
|
||||
|
||||
@@ -566,7 +572,8 @@ static inline lv_opa_t lv_obj_get_style_opa_layered(const struct _lv_obj_t * obj
|
||||
return (lv_opa_t)v.num;
|
||||
}
|
||||
|
||||
static inline const lv_color_filter_dsc_t * lv_obj_get_style_color_filter_dsc(const struct _lv_obj_t * obj, uint32_t part)
|
||||
static inline const lv_color_filter_dsc_t * lv_obj_get_style_color_filter_dsc(const struct _lv_obj_t * obj,
|
||||
uint32_t part)
|
||||
{
|
||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_COLOR_FILTER_DSC);
|
||||
return (const lv_color_filter_dsc_t *)v.ptr;
|
||||
@@ -762,8 +769,8 @@ void lv_obj_set_style_outline_color(struct _lv_obj_t * obj, lv_color_t value, lv
|
||||
void lv_obj_set_style_outline_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_shadow_ofs_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_shadow_ofs_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_shadow_offset_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_shadow_offset_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_shadow_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_shadow_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
|
||||
@@ -792,12 +799,14 @@ void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_
|
||||
void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_opa_layered(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value,
|
||||
lv_style_selector_t selector);
|
||||
void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_anim(struct _lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_anim_time(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_anim_speed(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value,
|
||||
lv_style_selector_t selector);
|
||||
void lv_obj_set_style_blend_mode(struct _lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_layout(struct _lv_obj_t * obj, uint16_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_base_dir(struct _lv_obj_t * obj, lv_base_dir_t value, lv_style_selector_t selector);
|
||||
@@ -806,9 +815,11 @@ void lv_obj_set_style_flex_main_place(struct _lv_obj_t * obj, lv_flex_align_t va
|
||||
void lv_obj_set_style_flex_cross_place(struct _lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_flex_track_place(struct _lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_flex_grow(struct _lv_obj_t * obj, uint8_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_grid_column_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_grid_column_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value,
|
||||
lv_style_selector_t selector);
|
||||
void lv_obj_set_style_grid_column_align(struct _lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_grid_row_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_grid_row_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value,
|
||||
lv_style_selector_t selector);
|
||||
void lv_obj_set_style_grid_row_align(struct _lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_grid_cell_column_pos(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
|
||||
void lv_obj_set_style_grid_cell_x_align(struct _lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector);
|
||||
|
||||
@@ -94,7 +94,7 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
|
||||
if(dsc->shadow_width == 0 ||
|
||||
dsc->shadow_opa <= LV_OPA_MIN ||
|
||||
(dsc->shadow_width == 1 && dsc->shadow_spread <= 0 &&
|
||||
dsc->shadow_ofs_x == 0 && dsc->shadow_ofs_y == 0)) {
|
||||
dsc->shadow_offset_x == 0 && dsc->shadow_offset_y == 0)) {
|
||||
has_shadow = false;
|
||||
}
|
||||
else {
|
||||
@@ -139,8 +139,8 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
|
||||
shadow_dsc->width = dsc->shadow_width;
|
||||
shadow_dsc->spread = dsc->shadow_spread;
|
||||
shadow_dsc->opa = dsc->shadow_opa;
|
||||
shadow_dsc->ofs_x = dsc->shadow_ofs_x;
|
||||
shadow_dsc->ofs_y = dsc->shadow_ofs_y;
|
||||
shadow_dsc->ofs_x = dsc->shadow_offset_x;
|
||||
shadow_dsc->ofs_y = dsc->shadow_offset_y;
|
||||
shadow_dsc->bg_cover = bg_cover;
|
||||
t->type = LV_DRAW_TASK_TYPE_BOX_SHADOW;
|
||||
lv_draw_finalize_task_creation(layer, t);
|
||||
|
||||
@@ -63,8 +63,8 @@ typedef struct {
|
||||
/*Shadow*/
|
||||
lv_color_t shadow_color;
|
||||
lv_coord_t shadow_width;
|
||||
lv_coord_t shadow_ofs_x;
|
||||
lv_coord_t shadow_ofs_y;
|
||||
lv_coord_t shadow_offset_x;
|
||||
lv_coord_t shadow_offset_y;
|
||||
lv_coord_t shadow_spread;
|
||||
lv_opa_t shadow_opa;
|
||||
} lv_draw_rect_dsc_t;
|
||||
|
||||
@@ -214,12 +214,21 @@ static inline void lv_obj_move_background(lv_obj_t * obj)
|
||||
#define lv_image_set_zoom lv_image_set_scale
|
||||
#define lv_image_get_zoom lv_image_get_scale
|
||||
|
||||
#define lv_obj_get_style_shadow_ofs_x lv_obj_get_style_shadow_offset_x
|
||||
#define lv_obj_get_style_shadow_ofs_y lv_obj_get_style_shadow_offset_y
|
||||
#define lv_obj_get_style_transform_zoom lv_obj_get_style_transform_scale
|
||||
#define lv_obj_get_style_transform_angle lv_obj_get_style_transform_rotation
|
||||
|
||||
#define lv_obj_set_style_shadow_ofs_x lv_obj_set_style_shadow_offset_x
|
||||
#define lv_obj_set_style_shadow_ofs_y lv_obj_set_style_shadow_offset_y
|
||||
#define lv_obj_set_style_transform_zoom lv_obj_set_style_transform_scale
|
||||
#define lv_obj_set_style_transform_angle lv_obj_set_style_transform_rotation
|
||||
|
||||
#define lv_style_set_shadow_ofs_x lv_style_set_shadow_offset_x
|
||||
#define lv_style_set_shadow_ofs_y lv_style_set_shadow_offset_y
|
||||
#define lv_style_set_transform_angle lv_style_set_transform_rotation
|
||||
#define lv_style_set_transform_zoom lv_style_set_transform_scale
|
||||
|
||||
#define LV_ZOOM_NONE LV_SCALE_NONE
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -91,8 +91,8 @@ const uint8_t _lv_style_builtin_prop_flag_lookup_table[_LV_STYLE_NUM_BUILT_IN_PR
|
||||
[LV_STYLE_OUTLINE_PAD] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE,
|
||||
|
||||
[LV_STYLE_SHADOW_WIDTH] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE,
|
||||
[LV_STYLE_SHADOW_OFS_X] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE,
|
||||
[LV_STYLE_SHADOW_OFS_Y] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE,
|
||||
[LV_STYLE_SHADOW_OFFSET_X] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE,
|
||||
[LV_STYLE_SHADOW_OFFSET_Y] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE,
|
||||
[LV_STYLE_SHADOW_SPREAD] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE,
|
||||
[LV_STYLE_SHADOW_COLOR] = 0,
|
||||
[LV_STYLE_SHADOW_OPA] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE,
|
||||
|
||||
@@ -253,8 +253,8 @@ enum _lv_style_prop_t {
|
||||
LV_STYLE_SHADOW_COLOR = 61,
|
||||
LV_STYLE_SHADOW_OPA = 62,
|
||||
|
||||
LV_STYLE_SHADOW_OFS_X = 64,
|
||||
LV_STYLE_SHADOW_OFS_Y = 65,
|
||||
LV_STYLE_SHADOW_OFFSET_X = 64,
|
||||
LV_STYLE_SHADOW_OFFSET_Y = 65,
|
||||
LV_STYLE_SHADOW_SPREAD = 66,
|
||||
|
||||
LV_STYLE_IMAGE_OPA = 68,
|
||||
|
||||
@@ -530,25 +530,25 @@ void lv_style_set_shadow_width(lv_style_t * style, lv_coord_t value)
|
||||
|
||||
const lv_style_prop_t _lv_style_const_prop_id_SHADOW_WIDTH = LV_STYLE_SHADOW_WIDTH;
|
||||
|
||||
void lv_style_set_shadow_ofs_x(lv_style_t * style, lv_coord_t value)
|
||||
void lv_style_set_shadow_offset_x(lv_style_t * style, lv_coord_t value)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_style_set_prop(style, LV_STYLE_SHADOW_OFS_X, v);
|
||||
lv_style_set_prop(style, LV_STYLE_SHADOW_OFFSET_X, v);
|
||||
}
|
||||
|
||||
const lv_style_prop_t _lv_style_const_prop_id_SHADOW_OFS_X = LV_STYLE_SHADOW_OFS_X;
|
||||
const lv_style_prop_t _lv_style_const_prop_id_SHADOW_OFFSET_X = LV_STYLE_SHADOW_OFFSET_X;
|
||||
|
||||
void lv_style_set_shadow_ofs_y(lv_style_t * style, lv_coord_t value)
|
||||
void lv_style_set_shadow_offset_y(lv_style_t * style, lv_coord_t value)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_style_set_prop(style, LV_STYLE_SHADOW_OFS_Y, v);
|
||||
lv_style_set_prop(style, LV_STYLE_SHADOW_OFFSET_Y, v);
|
||||
}
|
||||
|
||||
const lv_style_prop_t _lv_style_const_prop_id_SHADOW_OFS_Y = LV_STYLE_SHADOW_OFS_Y;
|
||||
const lv_style_prop_t _lv_style_const_prop_id_SHADOW_OFFSET_Y = LV_STYLE_SHADOW_OFFSET_Y;
|
||||
|
||||
void lv_style_set_shadow_spread(lv_style_t * style, lv_coord_t value)
|
||||
{
|
||||
|
||||
@@ -114,10 +114,10 @@ void lv_style_set_outline_pad(lv_style_t * style, lv_coord_t value);
|
||||
extern const lv_style_prop_t _lv_style_const_prop_id_OUTLINE_PAD;
|
||||
void lv_style_set_shadow_width(lv_style_t * style, lv_coord_t value);
|
||||
extern const lv_style_prop_t _lv_style_const_prop_id_SHADOW_WIDTH;
|
||||
void lv_style_set_shadow_ofs_x(lv_style_t * style, lv_coord_t value);
|
||||
extern const lv_style_prop_t _lv_style_const_prop_id_SHADOW_OFS_X;
|
||||
void lv_style_set_shadow_ofs_y(lv_style_t * style, lv_coord_t value);
|
||||
extern const lv_style_prop_t _lv_style_const_prop_id_SHADOW_OFS_Y;
|
||||
void lv_style_set_shadow_offset_x(lv_style_t * style, lv_coord_t value);
|
||||
extern const lv_style_prop_t _lv_style_const_prop_id_SHADOW_OFFSET_X;
|
||||
void lv_style_set_shadow_offset_y(lv_style_t * style, lv_coord_t value);
|
||||
extern const lv_style_prop_t _lv_style_const_prop_id_SHADOW_OFFSET_Y;
|
||||
void lv_style_set_shadow_spread(lv_style_t * style, lv_coord_t value);
|
||||
extern const lv_style_prop_t _lv_style_const_prop_id_SHADOW_SPREAD;
|
||||
void lv_style_set_shadow_color(lv_style_t * style, lv_color_t value);
|
||||
@@ -483,14 +483,14 @@ extern const lv_style_prop_t _lv_style_const_prop_id_GRID_CELL_ROW_SPAN;
|
||||
.prop_ptr = &_lv_style_const_prop_id_SHADOW_WIDTH, .value = { .num = (int32_t)val } \
|
||||
}
|
||||
|
||||
#define LV_STYLE_CONST_SHADOW_OFS_X(val) \
|
||||
#define LV_STYLE_CONST_SHADOW_OFFSET_X(val) \
|
||||
{ \
|
||||
.prop_ptr = &_lv_style_const_prop_id_SHADOW_OFS_X, .value = { .num = (int32_t)val } \
|
||||
.prop_ptr = &_lv_style_const_prop_id_SHADOW_OFFSET_X, .value = { .num = (int32_t)val } \
|
||||
}
|
||||
|
||||
#define LV_STYLE_CONST_SHADOW_OFS_Y(val) \
|
||||
#define LV_STYLE_CONST_SHADOW_OFFSET_Y(val) \
|
||||
{ \
|
||||
.prop_ptr = &_lv_style_const_prop_id_SHADOW_OFS_Y, .value = { .num = (int32_t)val } \
|
||||
.prop_ptr = &_lv_style_const_prop_id_SHADOW_OFFSET_Y, .value = { .num = (int32_t)val } \
|
||||
}
|
||||
|
||||
#define LV_STYLE_CONST_SHADOW_SPREAD(val) \
|
||||
|
||||
@@ -301,7 +301,7 @@ static void style_init(struct _my_theme_t * theme)
|
||||
lv_style_set_shadow_color(&theme->styles.btn, lv_palette_main(LV_PALETTE_GREY));
|
||||
lv_style_set_shadow_width(&theme->styles.btn, LV_DPX(3));
|
||||
lv_style_set_shadow_opa(&theme->styles.btn, LV_OPA_50);
|
||||
lv_style_set_shadow_ofs_y(&theme->styles.btn, _LV_DPX_CALC(theme->disp_dpi, LV_DPX(4)));
|
||||
lv_style_set_shadow_offset_y(&theme->styles.btn, _LV_DPX_CALC(theme->disp_dpi, LV_DPX(4)));
|
||||
}
|
||||
lv_style_set_text_color(&theme->styles.btn, theme->color_text);
|
||||
lv_style_set_pad_hor(&theme->styles.btn, PAD_DEF);
|
||||
|
||||
@@ -891,8 +891,8 @@ static lv_coord_t knob_get_extra_size(lv_obj_t * obj)
|
||||
lv_coord_t knob_shadow_size = 0;
|
||||
knob_shadow_size += lv_obj_get_style_shadow_width(obj, LV_PART_KNOB);
|
||||
knob_shadow_size += lv_obj_get_style_shadow_spread(obj, LV_PART_KNOB);
|
||||
knob_shadow_size += LV_ABS(lv_obj_get_style_shadow_ofs_x(obj, LV_PART_KNOB));
|
||||
knob_shadow_size += LV_ABS(lv_obj_get_style_shadow_ofs_y(obj, LV_PART_KNOB));
|
||||
knob_shadow_size += LV_ABS(lv_obj_get_style_shadow_offset_x(obj, LV_PART_KNOB));
|
||||
knob_shadow_size += LV_ABS(lv_obj_get_style_shadow_offset_y(obj, LV_PART_KNOB));
|
||||
|
||||
lv_coord_t knob_outline_size = 0;
|
||||
knob_outline_size += lv_obj_get_style_outline_width(obj, LV_PART_KNOB);
|
||||
|
||||
@@ -53,8 +53,8 @@ static void canvas_basic_render(uint8_t * canvas_buf, lv_color_format_t render_c
|
||||
rect_dsc.outline_opa = LV_OPA_60;
|
||||
rect_dsc.shadow_color = lv_palette_main(LV_PALETTE_ORANGE);
|
||||
rect_dsc.shadow_width = 10;
|
||||
rect_dsc.shadow_ofs_x = 5;
|
||||
rect_dsc.shadow_ofs_y = 10;
|
||||
rect_dsc.shadow_offset_x = 5;
|
||||
rect_dsc.shadow_offset_y = 10;
|
||||
|
||||
area.x1 = 10;
|
||||
area.x2 = 170;
|
||||
|
||||
Reference in New Issue
Block a user