refactor(style): rename style_anim_time -> style_anim_duration (#5338)
This commit is contained in:
committed by
GitHub
parent
d757aa24de
commit
fb0fc86895
@@ -605,7 +605,7 @@ static lv_obj_t * create_ctrl_box(lv_obj_t * parent)
|
|||||||
|
|
||||||
LV_IMAGE_DECLARE(img_lv_demo_music_slider_knob);
|
LV_IMAGE_DECLARE(img_lv_demo_music_slider_knob);
|
||||||
slider_obj = lv_slider_create(cont);
|
slider_obj = lv_slider_create(cont);
|
||||||
lv_obj_set_style_anim_time(slider_obj, 100, 0);
|
lv_obj_set_style_anim_duration(slider_obj, 100, 0);
|
||||||
lv_obj_add_flag(slider_obj, LV_OBJ_FLAG_CLICKABLE); /*No input from the slider*/
|
lv_obj_add_flag(slider_obj, LV_OBJ_FLAG_CLICKABLE); /*No input from the slider*/
|
||||||
|
|
||||||
#if LV_DEMO_MUSIC_LARGE == 0
|
#if LV_DEMO_MUSIC_LARGE == 0
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ static void obj_test_task_cb(lv_timer_t * tmr)
|
|||||||
auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 2 + 70);
|
auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 2 + 70);
|
||||||
|
|
||||||
obj = lv_slider_create(main_page);
|
obj = lv_slider_create(main_page);
|
||||||
lv_obj_set_style_anim_time(obj, LV_DEMO_STRESS_TIME_STEP * 8, 0);
|
lv_obj_set_style_anim_duration(obj, LV_DEMO_STRESS_TIME_STEP * 8, 0);
|
||||||
lv_slider_set_value(obj, 5000, LV_ANIM_ON); /*Animate to out of range value*/
|
lv_slider_set_value(obj, 5000, LV_ANIM_ON); /*Animate to out of range value*/
|
||||||
auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 5 + 22);
|
auto_delete(obj, LV_DEMO_STRESS_TIME_STEP * 5 + 22);
|
||||||
|
|
||||||
|
|||||||
@@ -828,8 +828,8 @@ The animation template for the object's animation. Should be a pointer to `lv_an
|
|||||||
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Ext. draw</strong> No</li>
|
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Ext. draw</strong> No</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
### anim_time
|
### anim_duration
|
||||||
The animation time in milliseconds. Its meaning is widget specific. E.g. blink time of the cursor on the text area or scroll time of a roller. See the widgets' documentation to learn more.
|
The animation duration in milliseconds. Its meaning is widget specific. E.g. blink time of the cursor on the text area or scroll time of a roller. See the widgets' documentation to learn more.
|
||||||
<ul>
|
<ul>
|
||||||
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Default</strong> 0</li>
|
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Default</strong> 0</li>
|
||||||
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Inherited</strong> No</li>
|
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Inherited</strong> No</li>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ void lv_example_bar_2(void)
|
|||||||
lv_style_set_border_width(&style_bg, 2);
|
lv_style_set_border_width(&style_bg, 2);
|
||||||
lv_style_set_pad_all(&style_bg, 6); /*To make the indicator smaller*/
|
lv_style_set_pad_all(&style_bg, 6); /*To make the indicator smaller*/
|
||||||
lv_style_set_radius(&style_bg, 6);
|
lv_style_set_radius(&style_bg, 6);
|
||||||
lv_style_set_anim_time(&style_bg, 1000);
|
lv_style_set_anim_duration(&style_bg, 1000);
|
||||||
|
|
||||||
lv_style_init(&style_indic);
|
lv_style_init(&style_indic);
|
||||||
lv_style_set_bg_opa(&style_indic, LV_OPA_COVER);
|
lv_style_set_bg_opa(&style_indic, LV_OPA_COVER);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ void lv_example_slider_1(void)
|
|||||||
lv_obj_center(slider);
|
lv_obj_center(slider);
|
||||||
lv_obj_add_event_cb(slider, slider_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
|
lv_obj_add_event_cb(slider, slider_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
|
||||||
|
|
||||||
lv_obj_set_style_anim_time(slider, 2000, 0);
|
lv_obj_set_style_anim_duration(slider, 2000, 0);
|
||||||
/*Create a label below the slider*/
|
/*Create a label below the slider*/
|
||||||
slider_label = lv_label_create(lv_screen_active());
|
slider_label = lv_label_create(lv_screen_active());
|
||||||
lv_label_set_text(slider_label, "0%");
|
lv_label_set_text(slider_label, "0%");
|
||||||
|
|||||||
@@ -369,9 +369,9 @@ props = [
|
|||||||
'style_type': 'ptr', 'var_type': 'const lv_anim_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
'style_type': 'ptr', 'var_type': 'const lv_anim_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||||
'dsc': "The animation template for the object's animation. Should be a pointer to `lv_anim_t`. The animation parameters are widget specific, e.g. animation time could be the E.g. blink time of the cursor on the text area or scroll time of a roller. See the widgets' documentation to learn more."},
|
'dsc': "The animation template for the object's animation. Should be a pointer to `lv_anim_t`. The animation parameters are widget specific, e.g. animation time could be the E.g. blink time of the cursor on the text area or scroll time of a roller. See the widgets' documentation to learn more."},
|
||||||
|
|
||||||
{'name': 'ANIM_TIME',
|
{'name': 'ANIM_DURATION',
|
||||||
'style_type': 'num', 'var_type': 'uint32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
'style_type': 'num', 'var_type': 'uint32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||||
'dsc': "The animation time in milliseconds. Its meaning is widget specific. E.g. blink time of the cursor on the text area or scroll time of a roller. See the widgets' documentation to learn more."},
|
'dsc': "The animation duration in milliseconds. Its meaning is widget specific. E.g. blink time of the cursor on the text area or scroll time of a roller. See the widgets' documentation to learn more."},
|
||||||
|
|
||||||
{'name': 'TRANSITION',
|
{'name': 'TRANSITION',
|
||||||
'style_type': 'ptr', 'var_type': 'const lv_style_transition_dsc_t *' , 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
'style_type': 'ptr', 'var_type': 'const lv_style_transition_dsc_t *' , 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||||
|
|||||||
@@ -690,7 +690,8 @@ void lv_obj_set_style_opa_layered(lv_obj_t * obj, lv_opa_t value, lv_style_selec
|
|||||||
lv_obj_set_local_style_prop(obj, LV_STYLE_OPA_LAYERED, v, selector);
|
lv_obj_set_local_style_prop(obj, LV_STYLE_OPA_LAYERED, v, selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector)
|
void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc_t * value,
|
||||||
|
lv_style_selector_t selector)
|
||||||
{
|
{
|
||||||
lv_style_value_t v = {
|
lv_style_value_t v = {
|
||||||
.ptr = value
|
.ptr = value
|
||||||
@@ -714,12 +715,12 @@ void lv_obj_set_style_anim(lv_obj_t * obj, const lv_anim_t * value, lv_style_sel
|
|||||||
lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM, v, selector);
|
lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM, v, selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_obj_set_style_anim_time(lv_obj_t * obj, uint32_t value, lv_style_selector_t selector)
|
void lv_obj_set_style_anim_duration(lv_obj_t * obj, uint32_t value, lv_style_selector_t selector)
|
||||||
{
|
{
|
||||||
lv_style_value_t v = {
|
lv_style_value_t v = {
|
||||||
.num = (int32_t)value
|
.num = (int32_t)value
|
||||||
};
|
};
|
||||||
lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM_TIME, v, selector);
|
lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM_DURATION, v, selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_obj_set_style_transition(lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector)
|
void lv_obj_set_style_transition(lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector)
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
**********************************************************************
|
**********************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef LV_OBJ_STYLE_GEN_H
|
#ifndef LV_OBJ_STYLE_GEN_H
|
||||||
#define LV_OBJ_STYLE_GEN_H
|
#define LV_OBJ_STYLE_GEN_H
|
||||||
|
|
||||||
@@ -226,7 +225,8 @@ static inline lv_color_t lv_obj_get_style_bg_grad_color(const lv_obj_t * obj, ui
|
|||||||
|
|
||||||
static inline lv_color_t lv_obj_get_style_bg_grad_color_filtered(const lv_obj_t * obj, uint32_t part)
|
static inline lv_color_t lv_obj_get_style_bg_grad_color_filtered(const 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;
|
return v.color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +286,8 @@ static inline lv_color_t lv_obj_get_style_bg_image_recolor(const lv_obj_t * obj,
|
|||||||
|
|
||||||
static inline lv_color_t lv_obj_get_style_bg_image_recolor_filtered(const lv_obj_t * obj, uint32_t part)
|
static inline lv_color_t lv_obj_get_style_bg_image_recolor_filtered(const 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;
|
return v.color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,7 +311,8 @@ static inline lv_color_t lv_obj_get_style_border_color(const lv_obj_t * obj, uin
|
|||||||
|
|
||||||
static inline lv_color_t lv_obj_get_style_border_color_filtered(const lv_obj_t * obj, uint32_t part)
|
static inline lv_color_t lv_obj_get_style_border_color_filtered(const 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;
|
return v.color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,7 +354,8 @@ static inline lv_color_t lv_obj_get_style_outline_color(const lv_obj_t * obj, ui
|
|||||||
|
|
||||||
static inline lv_color_t lv_obj_get_style_outline_color_filtered(const lv_obj_t * obj, uint32_t part)
|
static inline lv_color_t lv_obj_get_style_outline_color_filtered(const 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;
|
return v.color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -400,7 +403,8 @@ static inline lv_color_t lv_obj_get_style_shadow_color(const lv_obj_t * obj, uin
|
|||||||
|
|
||||||
static inline lv_color_t lv_obj_get_style_shadow_color_filtered(const lv_obj_t * obj, uint32_t part)
|
static inline lv_color_t lv_obj_get_style_shadow_color_filtered(const 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;
|
return v.color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,7 +428,8 @@ static inline lv_color_t lv_obj_get_style_image_recolor(const lv_obj_t * obj, ui
|
|||||||
|
|
||||||
static inline lv_color_t lv_obj_get_style_image_recolor_filtered(const lv_obj_t * obj, uint32_t part)
|
static inline lv_color_t lv_obj_get_style_image_recolor_filtered(const 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;
|
return v.color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,9 +607,9 @@ static inline const lv_anim_t * lv_obj_get_style_anim(const lv_obj_t * obj, uint
|
|||||||
return (const lv_anim_t *)v.ptr;
|
return (const lv_anim_t *)v.ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint32_t lv_obj_get_style_anim_time(const lv_obj_t * obj, uint32_t part)
|
static inline uint32_t lv_obj_get_style_anim_duration(const lv_obj_t * obj, uint32_t part)
|
||||||
{
|
{
|
||||||
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ANIM_TIME);
|
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ANIM_DURATION);
|
||||||
return (uint32_t)v.num;
|
return (uint32_t)v.num;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -815,10 +820,11 @@ void lv_obj_set_style_radius(lv_obj_t * obj, int32_t value, lv_style_selector_t
|
|||||||
void lv_obj_set_style_clip_corner(lv_obj_t * obj, bool value, lv_style_selector_t selector);
|
void lv_obj_set_style_clip_corner(lv_obj_t * obj, bool value, lv_style_selector_t selector);
|
||||||
void lv_obj_set_style_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
|
void lv_obj_set_style_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
|
||||||
void lv_obj_set_style_opa_layered(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
|
void lv_obj_set_style_opa_layered(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
|
||||||
void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector);
|
void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc_t * value,
|
||||||
|
lv_style_selector_t selector);
|
||||||
void lv_obj_set_style_color_filter_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
|
void lv_obj_set_style_color_filter_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
|
||||||
void lv_obj_set_style_anim(lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector);
|
void lv_obj_set_style_anim(lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector);
|
||||||
void lv_obj_set_style_anim_time(lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
|
void lv_obj_set_style_anim_duration(lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
|
||||||
void lv_obj_set_style_transition(lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector);
|
void lv_obj_set_style_transition(lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector);
|
||||||
void lv_obj_set_style_blend_mode(lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector);
|
void lv_obj_set_style_blend_mode(lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector);
|
||||||
void lv_obj_set_style_layout(lv_obj_t * obj, uint16_t value, lv_style_selector_t selector);
|
void lv_obj_set_style_layout(lv_obj_t * obj, uint16_t value, lv_style_selector_t selector);
|
||||||
@@ -846,5 +852,4 @@ void lv_obj_set_style_grid_cell_y_align(lv_obj_t * obj, lv_grid_align_t value, l
|
|||||||
void lv_obj_set_style_grid_cell_row_span(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
|
void lv_obj_set_style_grid_cell_row_span(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
|
||||||
#endif /*LV_USE_GRID*/
|
#endif /*LV_USE_GRID*/
|
||||||
|
|
||||||
|
|
||||||
#endif /* LV_OBJ_STYLE_GEN_H */
|
#endif /* LV_OBJ_STYLE_GEN_H */
|
||||||
|
|||||||
@@ -236,6 +236,17 @@ static inline void lv_obj_move_background(lv_obj_t * obj)
|
|||||||
#define lv_obj_get_child_cnt lv_obj_get_child_count
|
#define lv_obj_get_child_cnt lv_obj_get_child_count
|
||||||
#define lv_obj_get_disp lv_obj_get_display
|
#define lv_obj_get_disp lv_obj_get_display
|
||||||
|
|
||||||
|
#define LV_STYLE_ANIM_TIME LV_STYLE_ANIM_DURATION
|
||||||
|
#define LV_STYLE_IMG_OPA LV_STYLE_IMAGE_OPA
|
||||||
|
#define LV_STYLE_IMG_RECOLOR LV_STYLE_IMAGE_RECOLOR
|
||||||
|
#define LV_STYLE_IMG_RECOLOR_FILTERED LV_STYLE_IMAGE_RECOLOR_FILTERED
|
||||||
|
#define LV_STYLE_IMG_RECOLOR_OPA LV_STYLE_IMAGE_RECOLOR_OPA
|
||||||
|
#define LV_STYLE_SHADOW_OFS_X LV_STYLE_SHADOW_OFFSET_X
|
||||||
|
#define LV_STYLE_SHADOW_OFS_Y LV_STYLE_SHADOW_OFFSET_Y
|
||||||
|
#define LV_STYLE_TRANSFORM_ZOOM LV_STYLE_TRANSFORM_SCALE
|
||||||
|
#define LV_STYLE_TRANSFORM_ANGLE LV_STYLE_TRANSFORM_ROTATION
|
||||||
|
|
||||||
|
#define lv_obj_get_style_anim_time lv_obj_get_style_anim_duration
|
||||||
#define lv_obj_get_style_img_opa lv_obj_get_style_image_opa
|
#define lv_obj_get_style_img_opa lv_obj_get_style_image_opa
|
||||||
#define lv_obj_get_style_img_recolor lv_obj_get_style_image_recolor
|
#define lv_obj_get_style_img_recolor lv_obj_get_style_image_recolor
|
||||||
#define lv_obj_get_style_img_recolor_filtered lv_obj_get_style_image_recolor_filtered
|
#define lv_obj_get_style_img_recolor_filtered lv_obj_get_style_image_recolor_filtered
|
||||||
@@ -245,6 +256,7 @@ static inline void lv_obj_move_background(lv_obj_t * obj)
|
|||||||
#define lv_obj_get_style_transform_zoom lv_obj_get_style_transform_scale
|
#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_get_style_transform_angle lv_obj_get_style_transform_rotation
|
||||||
|
|
||||||
|
#define lv_obj_set_style_anim_time lv_obj_set_style_anim_duration
|
||||||
#define lv_obj_set_style_img_opa lv_obj_set_style_image_opa
|
#define lv_obj_set_style_img_opa lv_obj_set_style_image_opa
|
||||||
#define lv_obj_set_style_img_recolor lv_obj_set_style_image_recolor
|
#define lv_obj_set_style_img_recolor lv_obj_set_style_image_recolor
|
||||||
#define lv_obj_set_style_img_recolor_opa lv_obj_set_style_image_recolor_opa
|
#define lv_obj_set_style_img_recolor_opa lv_obj_set_style_image_recolor_opa
|
||||||
@@ -253,6 +265,7 @@ static inline void lv_obj_move_background(lv_obj_t * obj)
|
|||||||
#define lv_obj_set_style_transform_zoom lv_obj_set_style_transform_scale
|
#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_obj_set_style_transform_angle lv_obj_set_style_transform_rotation
|
||||||
|
|
||||||
|
#define lv_style_set_anim_time lv_style_set_anim_duration
|
||||||
#define lv_style_set_img_opa lv_style_set_image_opa
|
#define lv_style_set_img_opa lv_style_set_image_opa
|
||||||
#define lv_style_set_img_recolor lv_style_set_image_recolor
|
#define lv_style_set_img_recolor lv_style_set_image_recolor
|
||||||
#define lv_style_set_img_recolor_opa lv_style_set_image_recolor_opa
|
#define lv_style_set_img_recolor_opa lv_style_set_image_recolor_opa
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ const uint8_t _lv_style_builtin_prop_flag_lookup_table[_LV_STYLE_NUM_BUILT_IN_PR
|
|||||||
[LV_STYLE_OPA_LAYERED] = LV_STYLE_PROP_FLAG_LAYER_UPDATE,
|
[LV_STYLE_OPA_LAYERED] = LV_STYLE_PROP_FLAG_LAYER_UPDATE,
|
||||||
[LV_STYLE_COLOR_FILTER_DSC] = LV_STYLE_PROP_FLAG_INHERITABLE,
|
[LV_STYLE_COLOR_FILTER_DSC] = LV_STYLE_PROP_FLAG_INHERITABLE,
|
||||||
[LV_STYLE_COLOR_FILTER_OPA] = LV_STYLE_PROP_FLAG_INHERITABLE,
|
[LV_STYLE_COLOR_FILTER_OPA] = LV_STYLE_PROP_FLAG_INHERITABLE,
|
||||||
[LV_STYLE_ANIM_TIME] = 0,
|
[LV_STYLE_ANIM_DURATION] = 0,
|
||||||
[LV_STYLE_TRANSITION] = 0,
|
[LV_STYLE_TRANSITION] = 0,
|
||||||
[LV_STYLE_BLEND_MODE] = LV_STYLE_PROP_FLAG_LAYER_UPDATE,
|
[LV_STYLE_BLEND_MODE] = LV_STYLE_PROP_FLAG_LAYER_UPDATE,
|
||||||
[LV_STYLE_LAYOUT] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE,
|
[LV_STYLE_LAYOUT] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE,
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ enum _lv_style_prop_t {
|
|||||||
LV_STYLE_COLOR_FILTER_DSC = 97,
|
LV_STYLE_COLOR_FILTER_DSC = 97,
|
||||||
LV_STYLE_COLOR_FILTER_OPA = 98,
|
LV_STYLE_COLOR_FILTER_OPA = 98,
|
||||||
LV_STYLE_ANIM = 99,
|
LV_STYLE_ANIM = 99,
|
||||||
LV_STYLE_ANIM_TIME = 100,
|
LV_STYLE_ANIM_DURATION = 100,
|
||||||
LV_STYLE_TRANSITION = 102,
|
LV_STYLE_TRANSITION = 102,
|
||||||
LV_STYLE_BLEND_MODE = 103,
|
LV_STYLE_BLEND_MODE = 103,
|
||||||
LV_STYLE_TRANSFORM_WIDTH = 104,
|
LV_STYLE_TRANSFORM_WIDTH = 104,
|
||||||
|
|||||||
@@ -888,15 +888,15 @@ void lv_style_set_anim(lv_style_t * style, const lv_anim_t * value)
|
|||||||
|
|
||||||
const lv_style_prop_t _lv_style_const_prop_id_ANIM = LV_STYLE_ANIM;
|
const lv_style_prop_t _lv_style_const_prop_id_ANIM = LV_STYLE_ANIM;
|
||||||
|
|
||||||
void lv_style_set_anim_time(lv_style_t * style, uint32_t value)
|
void lv_style_set_anim_duration(lv_style_t * style, uint32_t value)
|
||||||
{
|
{
|
||||||
lv_style_value_t v = {
|
lv_style_value_t v = {
|
||||||
.num = (int32_t)value
|
.num = (int32_t)value
|
||||||
};
|
};
|
||||||
lv_style_set_prop(style, LV_STYLE_ANIM_TIME, v);
|
lv_style_set_prop(style, LV_STYLE_ANIM_DURATION, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
const lv_style_prop_t _lv_style_const_prop_id_ANIM_TIME = LV_STYLE_ANIM_TIME;
|
const lv_style_prop_t _lv_style_const_prop_id_ANIM_DURATION = LV_STYLE_ANIM_DURATION;
|
||||||
|
|
||||||
void lv_style_set_transition(lv_style_t * style, const lv_style_transition_dsc_t * value)
|
void lv_style_set_transition(lv_style_t * style, const lv_style_transition_dsc_t * value)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -185,8 +185,8 @@ void lv_style_set_color_filter_opa(lv_style_t * style, lv_opa_t value);
|
|||||||
LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_COLOR_FILTER_OPA;
|
LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_COLOR_FILTER_OPA;
|
||||||
void lv_style_set_anim(lv_style_t * style, const lv_anim_t * value);
|
void lv_style_set_anim(lv_style_t * style, const lv_anim_t * value);
|
||||||
LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_ANIM;
|
LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_ANIM;
|
||||||
void lv_style_set_anim_time(lv_style_t * style, uint32_t value);
|
void lv_style_set_anim_duration(lv_style_t * style, uint32_t value);
|
||||||
LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_ANIM_TIME;
|
LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_ANIM_DURATION;
|
||||||
void lv_style_set_transition(lv_style_t * style, const lv_style_transition_dsc_t * value);
|
void lv_style_set_transition(lv_style_t * style, const lv_style_transition_dsc_t * value);
|
||||||
LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_TRANSITION;
|
LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_TRANSITION;
|
||||||
void lv_style_set_blend_mode(lv_style_t * style, lv_blend_mode_t value);
|
void lv_style_set_blend_mode(lv_style_t * style, lv_blend_mode_t value);
|
||||||
@@ -673,9 +673,9 @@ LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t _lv_style_const_prop_id_BA
|
|||||||
.prop_ptr = &_lv_style_const_prop_id_ANIM, .value = { .ptr = val } \
|
.prop_ptr = &_lv_style_const_prop_id_ANIM, .value = { .ptr = val } \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LV_STYLE_CONST_ANIM_TIME(val) \
|
#define LV_STYLE_CONST_ANIM_DURATION(val) \
|
||||||
{ \
|
{ \
|
||||||
.prop_ptr = &_lv_style_const_prop_id_ANIM_TIME, .value = { .num = (int32_t)val } \
|
.prop_ptr = &_lv_style_const_prop_id_ANIM_DURATION, .value = { .num = (int32_t)val } \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LV_STYLE_CONST_TRANSITION(val) \
|
#define LV_STYLE_CONST_TRANSITION(val) \
|
||||||
|
|||||||
@@ -399,10 +399,10 @@ static void style_init(my_theme_t * theme)
|
|||||||
lv_style_set_radius(&theme->styles.knob, LV_RADIUS_CIRCLE);
|
lv_style_set_radius(&theme->styles.knob, LV_RADIUS_CIRCLE);
|
||||||
|
|
||||||
style_init_reset(&theme->styles.anim);
|
style_init_reset(&theme->styles.anim);
|
||||||
lv_style_set_anim_time(&theme->styles.anim, 200);
|
lv_style_set_anim_duration(&theme->styles.anim, 200);
|
||||||
|
|
||||||
style_init_reset(&theme->styles.anim_fast);
|
style_init_reset(&theme->styles.anim_fast);
|
||||||
lv_style_set_anim_time(&theme->styles.anim_fast, 120);
|
lv_style_set_anim_duration(&theme->styles.anim_fast, 120);
|
||||||
|
|
||||||
#if LV_USE_ARC
|
#if LV_USE_ARC
|
||||||
style_init_reset(&theme->styles.arc_indic);
|
style_init_reset(&theme->styles.arc_indic);
|
||||||
@@ -540,7 +540,7 @@ static void style_init(my_theme_t * theme)
|
|||||||
lv_style_set_border_width(&theme->styles.ta_cursor, _LV_DPX_CALC(theme->disp_dpi, 2));
|
lv_style_set_border_width(&theme->styles.ta_cursor, _LV_DPX_CALC(theme->disp_dpi, 2));
|
||||||
lv_style_set_pad_left(&theme->styles.ta_cursor, - _LV_DPX_CALC(theme->disp_dpi, 1));
|
lv_style_set_pad_left(&theme->styles.ta_cursor, - _LV_DPX_CALC(theme->disp_dpi, 1));
|
||||||
lv_style_set_border_side(&theme->styles.ta_cursor, LV_BORDER_SIDE_LEFT);
|
lv_style_set_border_side(&theme->styles.ta_cursor, LV_BORDER_SIDE_LEFT);
|
||||||
lv_style_set_anim_time(&theme->styles.ta_cursor, 400);
|
lv_style_set_anim_duration(&theme->styles.ta_cursor, 400);
|
||||||
|
|
||||||
style_init_reset(&theme->styles.ta_placeholder);
|
style_init_reset(&theme->styles.ta_placeholder);
|
||||||
lv_style_set_text_color(&theme->styles.ta_placeholder,
|
lv_style_set_text_color(&theme->styles.ta_placeholder,
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ static void style_init(my_theme_t * theme, bool dark_bg, const lv_font_t * font)
|
|||||||
lv_style_set_arc_width(&theme->styles.card, 2);
|
lv_style_set_arc_width(&theme->styles.card, 2);
|
||||||
lv_style_set_arc_color(&theme->styles.card, COLOR_FG);
|
lv_style_set_arc_color(&theme->styles.card, COLOR_FG);
|
||||||
lv_style_set_outline_color(&theme->styles.card, COLOR_FG);
|
lv_style_set_outline_color(&theme->styles.card, COLOR_FG);
|
||||||
lv_style_set_anim_time(&theme->styles.card, 300);
|
lv_style_set_anim_duration(&theme->styles.card, 300);
|
||||||
|
|
||||||
style_init_reset(&theme->styles.pr);
|
style_init_reset(&theme->styles.pr);
|
||||||
lv_style_set_border_width(&theme->styles.pr, BORDER_W_PR);
|
lv_style_set_border_width(&theme->styles.pr, BORDER_W_PR);
|
||||||
@@ -163,7 +163,7 @@ static void style_init(my_theme_t * theme, bool dark_bg, const lv_font_t * font)
|
|||||||
lv_style_set_border_color(&theme->styles.ta_cursor, COLOR_FG);
|
lv_style_set_border_color(&theme->styles.ta_cursor, COLOR_FG);
|
||||||
lv_style_set_border_width(&theme->styles.ta_cursor, 2);
|
lv_style_set_border_width(&theme->styles.ta_cursor, 2);
|
||||||
lv_style_set_bg_opa(&theme->styles.ta_cursor, LV_OPA_TRANSP);
|
lv_style_set_bg_opa(&theme->styles.ta_cursor, LV_OPA_TRANSP);
|
||||||
lv_style_set_anim_time(&theme->styles.ta_cursor, 500);
|
lv_style_set_anim_duration(&theme->styles.ta_cursor, 500);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_USE_CHART
|
#if LV_USE_CHART
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ static void style_init(my_theme_t * theme)
|
|||||||
lv_style_set_border_color(&theme->styles.ta_cursor, COLOR_DIM);
|
lv_style_set_border_color(&theme->styles.ta_cursor, COLOR_DIM);
|
||||||
lv_style_set_border_width(&theme->styles.ta_cursor, 2);
|
lv_style_set_border_width(&theme->styles.ta_cursor, 2);
|
||||||
lv_style_set_bg_opa(&theme->styles.ta_cursor, LV_OPA_TRANSP);
|
lv_style_set_bg_opa(&theme->styles.ta_cursor, LV_OPA_TRANSP);
|
||||||
lv_style_set_anim_time(&theme->styles.ta_cursor, 500);
|
lv_style_set_anim_duration(&theme->styles.ta_cursor, 500);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -646,7 +646,7 @@ static void lv_bar_set_value_with_anim(lv_obj_t * obj, int32_t new_value, int32_
|
|||||||
lv_anim_set_exec_cb(&a, lv_bar_anim);
|
lv_anim_set_exec_cb(&a, lv_bar_anim);
|
||||||
lv_anim_set_values(&a, LV_BAR_ANIM_STATE_START, LV_BAR_ANIM_STATE_END);
|
lv_anim_set_values(&a, LV_BAR_ANIM_STATE_START, LV_BAR_ANIM_STATE_END);
|
||||||
lv_anim_set_ready_cb(&a, lv_bar_anim_ready);
|
lv_anim_set_ready_cb(&a, lv_bar_anim_ready);
|
||||||
lv_anim_set_duration(&a, lv_obj_get_style_anim_time(obj, LV_PART_MAIN));
|
lv_anim_set_duration(&a, lv_obj_get_style_anim_duration(obj, LV_PART_MAIN));
|
||||||
lv_anim_start(&a);
|
lv_anim_start(&a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -869,7 +869,7 @@ static void lv_label_refr_text(lv_obj_t * obj)
|
|||||||
/*In scroll mode start an offset animation*/
|
/*In scroll mode start an offset animation*/
|
||||||
if(label->long_mode == LV_LABEL_LONG_SCROLL) {
|
if(label->long_mode == LV_LABEL_LONG_SCROLL) {
|
||||||
const lv_anim_t * anim_template = lv_obj_get_style_anim(obj, LV_PART_MAIN);
|
const lv_anim_t * anim_template = lv_obj_get_style_anim(obj, LV_PART_MAIN);
|
||||||
uint32_t anim_time = lv_obj_get_style_anim_time(obj, LV_PART_MAIN);
|
uint32_t anim_time = lv_obj_get_style_anim_duration(obj, LV_PART_MAIN);
|
||||||
if(anim_time == 0) anim_time = LV_LABEL_DEF_SCROLL_SPEED;
|
if(anim_time == 0) anim_time = LV_LABEL_DEF_SCROLL_SPEED;
|
||||||
lv_anim_t a;
|
lv_anim_t a;
|
||||||
lv_anim_init(&a);
|
lv_anim_init(&a);
|
||||||
@@ -980,7 +980,7 @@ static void lv_label_refr_text(lv_obj_t * obj)
|
|||||||
/*In roll inf. mode keep the size but start offset animations*/
|
/*In roll inf. mode keep the size but start offset animations*/
|
||||||
else if(label->long_mode == LV_LABEL_LONG_SCROLL_CIRCULAR) {
|
else if(label->long_mode == LV_LABEL_LONG_SCROLL_CIRCULAR) {
|
||||||
const lv_anim_t * anim_template = lv_obj_get_style_anim(obj, LV_PART_MAIN);
|
const lv_anim_t * anim_template = lv_obj_get_style_anim(obj, LV_PART_MAIN);
|
||||||
uint32_t anim_time = lv_obj_get_style_anim_time(obj, LV_PART_MAIN);
|
uint32_t anim_time = lv_obj_get_style_anim_duration(obj, LV_PART_MAIN);
|
||||||
if(anim_time == 0) anim_time = LV_LABEL_DEF_SCROLL_SPEED;
|
if(anim_time == 0) anim_time = LV_LABEL_DEF_SCROLL_SPEED;
|
||||||
lv_anim_t a;
|
lv_anim_t a;
|
||||||
lv_anim_init(&a);
|
lv_anim_init(&a);
|
||||||
|
|||||||
@@ -597,7 +597,7 @@ static void refr_position(lv_obj_t * obj, lv_anim_enable_t anim_en)
|
|||||||
const int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN);
|
const int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN);
|
||||||
const int32_t font_h = lv_font_get_line_height(font);
|
const int32_t font_h = lv_font_get_line_height(font);
|
||||||
const int32_t h = lv_obj_get_content_height(obj);
|
const int32_t h = lv_obj_get_content_height(obj);
|
||||||
uint32_t anim_time = lv_obj_get_style_anim_time(obj, LV_PART_MAIN);
|
uint32_t anim_time = lv_obj_get_style_anim_duration(obj, LV_PART_MAIN);
|
||||||
|
|
||||||
/*Normally the animation's `end_cb` sets correct position of the roller if infinite.
|
/*Normally the animation's `end_cb` sets correct position of the roller if infinite.
|
||||||
*But without animations we have to do it manually*/
|
*But without animations we have to do it manually*/
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ static void lv_switch_trigger_anim(lv_obj_t * obj)
|
|||||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||||
lv_switch_t * sw = (lv_switch_t *)obj;
|
lv_switch_t * sw = (lv_switch_t *)obj;
|
||||||
|
|
||||||
uint32_t anim_dur_full = lv_obj_get_style_anim_time(obj, LV_PART_MAIN);
|
uint32_t anim_dur_full = lv_obj_get_style_anim_duration(obj, LV_PART_MAIN);
|
||||||
|
|
||||||
if(anim_dur_full > 0) {
|
if(anim_dur_full > 0) {
|
||||||
bool chk = lv_obj_get_state(obj) & LV_STATE_CHECKED;
|
bool chk = lv_obj_get_state(obj) & LV_STATE_CHECKED;
|
||||||
|
|||||||
@@ -1039,7 +1039,7 @@ static bool char_is_accepted(lv_obj_t * obj, uint32_t c)
|
|||||||
static void start_cursor_blink(lv_obj_t * obj)
|
static void start_cursor_blink(lv_obj_t * obj)
|
||||||
{
|
{
|
||||||
lv_textarea_t * ta = (lv_textarea_t *)obj;
|
lv_textarea_t * ta = (lv_textarea_t *)obj;
|
||||||
uint32_t blink_time = lv_obj_get_style_anim_time(obj, LV_PART_CURSOR);
|
uint32_t blink_time = lv_obj_get_style_anim_duration(obj, LV_PART_CURSOR);
|
||||||
if(blink_time == 0) {
|
if(blink_time == 0) {
|
||||||
lv_anim_delete(obj, cursor_blink_anim_cb);
|
lv_anim_delete(obj, cursor_blink_anim_cb);
|
||||||
ta->cursor.show = 1;
|
ta->cursor.show = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user