From d28f80d3626db300540efa78b6218d20a81aca25 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 31 Oct 2023 19:10:02 +0100 Subject: [PATCH] refactor(style): rename shadow_ofs to shadow_offset --- demos/flex_layout/lv_demo_flex_layout_view.c | 2 +- demos/multilang/lv_demo_multilang.c | 4 +- demos/render/lv_demo_render.c | 16 +++---- demos/scroll/lv_demo_scroll.c | 4 +- demos/transform/lv_demo_transform.c | 4 +- docs/overview/style-props.md | 18 ++++---- docs/overview/style-props.rst | 10 ++--- .../others/observer/lv_example_observer_5.c | 4 +- .../others/observer/lv_example_observer_6.c | 6 +-- examples/styles/lv_example_style_11.c | 2 +- examples/styles/lv_example_style_11.py | 2 +- examples/styles/lv_example_style_5.py | 4 +- examples/widgets/btn/lv_example_btn_2.c | 4 +- examples/widgets/btn/lv_example_btn_2.py | 4 +- .../btnmatrix/lv_example_btnmatrix_2.c | 4 +- examples/widgets/canvas/lv_example_canvas_1.c | 4 +- .../widgets/canvas/lv_example_canvas_1.py | 4 +- scripts/style_api_gen.py | 4 +- src/core/lv_obj_draw.c | 8 ++-- src/core/lv_obj_style.c | 4 +- src/core/lv_obj_style_gen.c | 17 ++++--- src/core/lv_obj_style_gen.h | 45 ++++++++++++------- src/draw/lv_draw_rect.c | 6 +-- src/draw/lv_draw_rect.h | 4 +- src/lv_api_map.h | 11 ++++- src/misc/lv_style.c | 4 +- src/misc/lv_style.h | 4 +- src/misc/lv_style_gen.c | 12 ++--- src/misc/lv_style_gen.h | 16 +++---- src/themes/default/lv_theme_default.c | 2 +- src/widgets/arc/lv_arc.c | 4 +- tests/src/test_cases/draw/test_draw_blend.c | 4 +- 32 files changed, 132 insertions(+), 109 deletions(-) diff --git a/demos/flex_layout/lv_demo_flex_layout_view.c b/demos/flex_layout/lv_demo_flex_layout_view.c index 16f47d9f6..944e6643c 100644 --- a/demos/flex_layout/lv_demo_flex_layout_view.c +++ b/demos/flex_layout/lv_demo_flex_layout_view.c @@ -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( diff --git a/demos/multilang/lv_demo_multilang.c b/demos/multilang/lv_demo_multilang.c index cd508349a..209085400 100644 --- a/demos/multilang/lv_demo_multilang.c +++ b/demos/multilang/lv_demo_multilang.c @@ -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); diff --git a/demos/render/lv_demo_render.c b/demos/render/lv_demo_render.c index 8c852e47b..d33a486ae 100644 --- a/demos/render/lv_demo_render.c +++ b/demos/render/lv_demo_render.c @@ -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); } } diff --git a/demos/scroll/lv_demo_scroll.c b/demos/scroll/lv_demo_scroll.c index ac1f58586..7e5a00636 100644 --- a/demos/scroll/lv_demo_scroll.c +++ b/demos/scroll/lv_demo_scroll.c @@ -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)); diff --git a/demos/transform/lv_demo_transform.c b/demos/transform/lv_demo_transform.c index 4fe3ea2a7..5a762b131 100644 --- a/demos/transform/lv_demo_transform.c +++ b/demos/transform/lv_demo_transform.c @@ -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); diff --git a/docs/overview/style-props.md b/docs/overview/style-props.md index 15ce2b442..d507e9e4c 100644 --- a/docs/overview/style-props.md +++ b/docs/overview/style-props.md @@ -226,7 +226,7 @@ Sets the padding between the columns. Used by the layouts. Properties to describe spacing around an object. Very similar to the margin properties in HTML. ### margin_top -Sets the margin on the top. The object will keep this space from its siblings in layouts. +Sets the margin on the top. The object will keep this space from its siblings in layouts. -shadow_ofs_y +shadow_offset_y ~~~~~~~~~~~~ Set an offset on the shadow in pixels in Y direction. diff --git a/examples/others/observer/lv_example_observer_5.c b/examples/others/observer/lv_example_observer_5.c index 0bc370c6c..68e829d7e 100644 --- a/examples/others/observer/lv_example_observer_5.c +++ b/examples/others/observer/lv_example_observer_5.c @@ -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); diff --git a/examples/others/observer/lv_example_observer_6.c b/examples/others/observer/lv_example_observer_6.c index 4f9bee2e2..e75b99b29 100644 --- a/examples/others/observer/lv_example_observer_6.c +++ b/examples/others/observer/lv_example_observer_6.c @@ -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); diff --git a/examples/styles/lv_example_style_11.c b/examples/styles/lv_example_style_11.c index efe66520c..5b3e3ca77 100644 --- a/examples/styles/lv_example_style_11.c +++ b/examples/styles/lv_example_style_11.c @@ -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); diff --git a/examples/styles/lv_example_style_11.py b/examples/styles/lv_example_style_11.py index dbdb428ba..4cd52575d 100644 --- a/examples/styles/lv_example_style_11.py +++ b/examples/styles/lv_example_style_11.py @@ -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) diff --git a/examples/styles/lv_example_style_5.py b/examples/styles/lv_example_style_5.py index 188fde0f1..d1efbb286 100644 --- a/examples/styles/lv_example_style_5.py +++ b/examples/styles/lv_example_style_5.py @@ -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()) diff --git a/examples/widgets/btn/lv_example_btn_2.c b/examples/widgets/btn/lv_example_btn_2.c index 7a063a350..6f694adf3 100644 --- a/examples/widgets/btn/lv_example_btn_2.c +++ b/examples/widgets/btn/lv_example_btn_2.c @@ -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)); diff --git a/examples/widgets/btn/lv_example_btn_2.py b/examples/widgets/btn/lv_example_btn_2.py index bd3d52cc3..a824231b0 100644 --- a/examples/widgets/btn/lv_example_btn_2.py +++ b/examples/widgets/btn/lv_example_btn_2.py @@ -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)) diff --git a/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c b/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c index d16510444..2a3073309 100644 --- a/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c +++ b/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c @@ -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; diff --git a/examples/widgets/canvas/lv_example_canvas_1.c b/examples/widgets/canvas/lv_example_canvas_1.c index 1c1f98d8b..4b4319718 100644 --- a/examples/widgets/canvas/lv_example_canvas_1.c +++ b/examples/widgets/canvas/lv_example_canvas_1.c @@ -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); diff --git a/examples/widgets/canvas/lv_example_canvas_1.py b/examples/widgets/canvas/lv_example_canvas_1.py index dae286d19..c3fdc7646 100644 --- a/examples/widgets/canvas/lv_example_canvas_1.py +++ b/examples/widgets/canvas/lv_example_canvas_1.py @@ -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() diff --git a/scripts/style_api_gen.py b/scripts/style_api_gen.py index af6c1660f..f0bdcd471 100755 --- a/scripts/style_api_gen.py +++ b/scripts/style_api_gen.py @@ -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. "}, diff --git a/src/core/lv_obj_draw.c b/src/core/lv_obj_draw.c index 9cc0b11aa..12a78ff31 100644 --- a/src/core/lv_obj_draw.c +++ b/src/core/lv_obj_draw.c @@ -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); } diff --git a/src/core/lv_obj_style.c b/src/core/lv_obj_style.c index 8ed6fe94d..267d1138d 100644 --- a/src/core/lv_obj_style.c +++ b/src/core/lv_obj_style.c @@ -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; diff --git a/src/core/lv_obj_style_gen.c b/src/core/lv_obj_style_gen.c index c64f229ad..4f24721dc 100644 --- a/src/core/lv_obj_style_gen.c +++ b/src/core/lv_obj_style_gen.c @@ -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 diff --git a/src/core/lv_obj_style_gen.h b/src/core/lv_obj_style_gen.h index 281e47d1c..ecaf16b4b 100644 --- a/src/core/lv_obj_style_gen.h +++ b/src/core/lv_obj_style_gen.h @@ -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); diff --git a/src/draw/lv_draw_rect.c b/src/draw/lv_draw_rect.c index 67dfdb2c9..4396ff7d7 100644 --- a/src/draw/lv_draw_rect.c +++ b/src/draw/lv_draw_rect.c @@ -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); diff --git a/src/draw/lv_draw_rect.h b/src/draw/lv_draw_rect.h index 97e02d204..7220830ce 100644 --- a/src/draw/lv_draw_rect.h +++ b/src/draw/lv_draw_rect.h @@ -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; diff --git a/src/lv_api_map.h b/src/lv_api_map.h index c41eda69e..3eea8abf3 100644 --- a/src/lv_api_map.h +++ b/src/lv_api_map.h @@ -214,13 +214,22 @@ 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 + +#define LV_ZOOM_NONE LV_SCALE_NONE /********************** * MACROS diff --git a/src/misc/lv_style.c b/src/misc/lv_style.c index 2b04d51f0..64214b1b4 100644 --- a/src/misc/lv_style.c +++ b/src/misc/lv_style.c @@ -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, diff --git a/src/misc/lv_style.h b/src/misc/lv_style.h index 8b9166ccc..dd0e5c24b 100644 --- a/src/misc/lv_style.h +++ b/src/misc/lv_style.h @@ -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, diff --git a/src/misc/lv_style_gen.c b/src/misc/lv_style_gen.c index 56b5fffb2..79b8d6baa 100644 --- a/src/misc/lv_style_gen.c +++ b/src/misc/lv_style_gen.c @@ -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) { diff --git a/src/misc/lv_style_gen.h b/src/misc/lv_style_gen.h index 4d0221d4b..2af32055b 100644 --- a/src/misc/lv_style_gen.h +++ b/src/misc/lv_style_gen.h @@ -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) \ diff --git a/src/themes/default/lv_theme_default.c b/src/themes/default/lv_theme_default.c index 816a52b2e..f641cfbd6 100644 --- a/src/themes/default/lv_theme_default.c +++ b/src/themes/default/lv_theme_default.c @@ -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); diff --git a/src/widgets/arc/lv_arc.c b/src/widgets/arc/lv_arc.c index 5169e50fe..974bf78f3 100644 --- a/src/widgets/arc/lv_arc.c +++ b/src/widgets/arc/lv_arc.c @@ -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); diff --git a/tests/src/test_cases/draw/test_draw_blend.c b/tests/src/test_cases/draw/test_draw_blend.c index 9bec07d50..67d44f788 100644 --- a/tests/src/test_cases/draw/test_draw_blend.c +++ b/tests/src/test_cases/draw/test_draw_blend.c @@ -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;