add LV_STYLE_VALUE_... properties
This commit is contained in:
@@ -65,6 +65,7 @@ static void delete_children(lv_obj_t * obj);
|
|||||||
static void base_dir_refr_children(lv_obj_t * obj);
|
static void base_dir_refr_children(lv_obj_t * obj);
|
||||||
static void obj_state_anim_cb(void * p, lv_anim_value_t value);
|
static void obj_state_anim_cb(void * p, lv_anim_value_t value);
|
||||||
static void lv_event_mark_deleted(lv_obj_t * obj);
|
static void lv_event_mark_deleted(lv_obj_t * obj);
|
||||||
|
static void align_core(const lv_obj_t * base, const lv_obj_t * to_align, lv_align_t align, lv_point_t * res);
|
||||||
static void lv_obj_del_async_cb(void * obj);
|
static void lv_obj_del_async_cb(void * obj);
|
||||||
static lv_design_res_t lv_obj_design(lv_obj_t * obj, const lv_area_t * clip_area, lv_design_mode_t mode);
|
static lv_design_res_t lv_obj_design(lv_obj_t * obj, const lv_area_t * clip_area, lv_design_mode_t mode);
|
||||||
static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param);
|
static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param);
|
||||||
@@ -817,133 +818,23 @@ void lv_obj_align(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_co
|
|||||||
{
|
{
|
||||||
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
|
LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
|
||||||
|
|
||||||
lv_coord_t new_x = lv_obj_get_x(obj);
|
if(base == NULL) base = lv_obj_get_parent(obj);
|
||||||
lv_coord_t new_y = lv_obj_get_y(obj);
|
|
||||||
|
|
||||||
if(base == NULL) {
|
|
||||||
base = lv_obj_get_parent(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
LV_ASSERT_OBJ(base, LV_OBJX_NAME);
|
LV_ASSERT_OBJ(base, LV_OBJX_NAME);
|
||||||
|
|
||||||
|
lv_point_t new_pos;
|
||||||
switch(align) {
|
lv_area_align(&base->coords, &obj->coords, align, &new_pos);
|
||||||
case LV_ALIGN_CENTER:
|
|
||||||
new_x = lv_obj_get_width(base) / 2 - lv_obj_get_width(obj) / 2;
|
|
||||||
new_y = lv_obj_get_height(base) / 2 - lv_obj_get_height(obj) / 2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_IN_TOP_LEFT:
|
|
||||||
new_x = 0;
|
|
||||||
new_y = 0;
|
|
||||||
break;
|
|
||||||
case LV_ALIGN_IN_TOP_MID:
|
|
||||||
new_x = lv_obj_get_width(base) / 2 - lv_obj_get_width(obj) / 2;
|
|
||||||
new_y = 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_IN_TOP_RIGHT:
|
|
||||||
new_x = lv_obj_get_width(base) - lv_obj_get_width(obj);
|
|
||||||
new_y = 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_IN_BOTTOM_LEFT:
|
|
||||||
new_x = 0;
|
|
||||||
new_y = lv_obj_get_height(base) - lv_obj_get_height(obj);
|
|
||||||
break;
|
|
||||||
case LV_ALIGN_IN_BOTTOM_MID:
|
|
||||||
new_x = lv_obj_get_width(base) / 2 - lv_obj_get_width(obj) / 2;
|
|
||||||
new_y = lv_obj_get_height(base) - lv_obj_get_height(obj);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_IN_BOTTOM_RIGHT:
|
|
||||||
new_x = lv_obj_get_width(base) - lv_obj_get_width(obj);
|
|
||||||
new_y = lv_obj_get_height(base) - lv_obj_get_height(obj);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_IN_LEFT_MID:
|
|
||||||
new_x = 0;
|
|
||||||
new_y = lv_obj_get_height(base) / 2 - lv_obj_get_height(obj) / 2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_IN_RIGHT_MID:
|
|
||||||
new_x = lv_obj_get_width(base) - lv_obj_get_width(obj);
|
|
||||||
new_y = lv_obj_get_height(base) / 2 - lv_obj_get_height(obj) / 2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_OUT_TOP_LEFT:
|
|
||||||
new_x = 0;
|
|
||||||
new_y = -lv_obj_get_height(obj);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_OUT_TOP_MID:
|
|
||||||
new_x = lv_obj_get_width(base) / 2 - lv_obj_get_width(obj) / 2;
|
|
||||||
new_y = -lv_obj_get_height(obj);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_OUT_TOP_RIGHT:
|
|
||||||
new_x = lv_obj_get_width(base) - lv_obj_get_width(obj);
|
|
||||||
new_y = -lv_obj_get_height(obj);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_OUT_BOTTOM_LEFT:
|
|
||||||
new_x = 0;
|
|
||||||
new_y = lv_obj_get_height(base);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_OUT_BOTTOM_MID:
|
|
||||||
new_x = lv_obj_get_width(base) / 2 - lv_obj_get_width(obj) / 2;
|
|
||||||
new_y = lv_obj_get_height(base);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_OUT_BOTTOM_RIGHT:
|
|
||||||
new_x = lv_obj_get_width(base) - lv_obj_get_width(obj);
|
|
||||||
new_y = lv_obj_get_height(base);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_OUT_LEFT_TOP:
|
|
||||||
new_x = -lv_obj_get_width(obj);
|
|
||||||
new_y = 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_OUT_LEFT_MID:
|
|
||||||
new_x = -lv_obj_get_width(obj);
|
|
||||||
new_y = lv_obj_get_height(base) / 2 - lv_obj_get_height(obj) / 2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_OUT_LEFT_BOTTOM:
|
|
||||||
new_x = -lv_obj_get_width(obj);
|
|
||||||
new_y = lv_obj_get_height(base) - lv_obj_get_height(obj);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_OUT_RIGHT_TOP:
|
|
||||||
new_x = lv_obj_get_width(base);
|
|
||||||
new_y = 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_OUT_RIGHT_MID:
|
|
||||||
new_x = lv_obj_get_width(base);
|
|
||||||
new_y = lv_obj_get_height(base) / 2 - lv_obj_get_height(obj) / 2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LV_ALIGN_OUT_RIGHT_BOTTOM:
|
|
||||||
new_x = lv_obj_get_width(base);
|
|
||||||
new_y = lv_obj_get_height(base) - lv_obj_get_height(obj);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Bring together the coordination system of base and obj*/
|
/*Bring together the coordination system of base and obj*/
|
||||||
lv_obj_t * par = lv_obj_get_parent(obj);
|
lv_obj_t * par = lv_obj_get_parent(obj);
|
||||||
lv_coord_t base_abs_x = base->coords.x1;
|
|
||||||
lv_coord_t base_abs_y = base->coords.y1;
|
|
||||||
lv_coord_t par_abs_x = par->coords.x1;
|
lv_coord_t par_abs_x = par->coords.x1;
|
||||||
lv_coord_t par_abs_y = par->coords.y1;
|
lv_coord_t par_abs_y = par->coords.y1;
|
||||||
new_x += x_mod + base_abs_x;
|
new_pos.x += x_mod;
|
||||||
new_y += y_mod + base_abs_y;
|
new_pos.y += y_mod;
|
||||||
new_x -= par_abs_x;
|
new_pos.x -= par_abs_x;
|
||||||
new_y -= par_abs_y;
|
new_pos.y -= par_abs_y;
|
||||||
|
|
||||||
lv_obj_set_pos(obj, new_x, new_y);
|
lv_obj_set_pos(obj, new_pos.x, new_pos.y);
|
||||||
|
|
||||||
#if LV_USE_OBJ_REALIGN
|
#if LV_USE_OBJ_REALIGN
|
||||||
/*Save the last align parameters to use them in `lv_obj_realign`*/
|
/*Save the last align parameters to use them in `lv_obj_realign`*/
|
||||||
@@ -2299,6 +2190,7 @@ lv_opa_t lv_obj_get_style_opa(const lv_obj_t * obj, uint8_t part, lv_style_prope
|
|||||||
case LV_STYLE_BORDER_OPA:
|
case LV_STYLE_BORDER_OPA:
|
||||||
case LV_STYLE_SHADOW_OPA:
|
case LV_STYLE_SHADOW_OPA:
|
||||||
case LV_STYLE_PATTERN_OPA:
|
case LV_STYLE_PATTERN_OPA:
|
||||||
|
case LV_STYLE_VALUE_OPA:
|
||||||
return LV_OPA_COVER;
|
return LV_OPA_COVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2354,7 +2246,8 @@ const void * lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, lv_style_p
|
|||||||
/*Handle unset values*/
|
/*Handle unset values*/
|
||||||
prop = prop & (~LV_STYLE_STATE_MASK);
|
prop = prop & (~LV_STYLE_STATE_MASK);
|
||||||
switch(prop) {
|
switch(prop) {
|
||||||
case LV_STYLE_FONT:
|
case LV_STYLE_TEXT_FONT:
|
||||||
|
case LV_STYLE_VALUE_FONT:
|
||||||
return LV_FONT_DEFAULT;
|
return LV_FONT_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2807,6 +2700,7 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
|||||||
draw_dsc->border_opa = LV_OPA_TRANSP;
|
draw_dsc->border_opa = LV_OPA_TRANSP;
|
||||||
draw_dsc->shadow_opa = LV_OPA_TRANSP;
|
draw_dsc->shadow_opa = LV_OPA_TRANSP;
|
||||||
draw_dsc->pattern_opa = LV_OPA_TRANSP;
|
draw_dsc->pattern_opa = LV_OPA_TRANSP;
|
||||||
|
draw_dsc->value_opa = LV_OPA_TRANSP;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2841,7 +2735,7 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
|||||||
if(draw_dsc->pattern_image) {
|
if(draw_dsc->pattern_image) {
|
||||||
draw_dsc->pattern_opa = lv_obj_get_style_pattern_opa(obj, part);
|
draw_dsc->pattern_opa = lv_obj_get_style_pattern_opa(obj, part);
|
||||||
if(draw_dsc->pattern_opa > LV_OPA_MIN) {
|
if(draw_dsc->pattern_opa > LV_OPA_MIN) {
|
||||||
draw_dsc->pattern_repeate = lv_obj_get_style_pattern_repeat(obj, part);
|
draw_dsc->pattern_blend_mode = lv_obj_get_style_pattern_blend_mode(obj, part);
|
||||||
draw_dsc->pattern_recolor_opa = lv_obj_get_style_pattern_recolor_opa(obj, part);
|
draw_dsc->pattern_recolor_opa = lv_obj_get_style_pattern_recolor_opa(obj, part);
|
||||||
if(lv_img_src_get_type(draw_dsc->pattern_image) == LV_IMG_SRC_SYMBOL) {
|
if(lv_img_src_get_type(draw_dsc->pattern_image) == LV_IMG_SRC_SYMBOL) {
|
||||||
draw_dsc->pattern_recolor = lv_obj_get_style_pattern_recolor(obj, part);
|
draw_dsc->pattern_recolor = lv_obj_get_style_pattern_recolor(obj, part);
|
||||||
@@ -2862,6 +2756,24 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
|||||||
draw_dsc->shadow_ofs_y = lv_obj_get_style_shadow_offset_y(obj, part);
|
draw_dsc->shadow_ofs_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_spread = lv_obj_get_style_shadow_spread(obj, part);
|
||||||
draw_dsc->shadow_color = lv_obj_get_style_shadow_color(obj, part);
|
draw_dsc->shadow_color = lv_obj_get_style_shadow_color(obj, part);
|
||||||
|
draw_dsc->shadow_blend_mode = lv_obj_get_style_shadow_blend_mode(obj, part);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(draw_dsc->value_opa > LV_OPA_MIN) {
|
||||||
|
draw_dsc->value_str = lv_obj_get_style_value_str(obj, part);
|
||||||
|
if(draw_dsc->value_str) {
|
||||||
|
draw_dsc->value_opa = lv_obj_get_style_value_opa(obj, part);
|
||||||
|
if(draw_dsc->value_opa > LV_OPA_MIN) {
|
||||||
|
draw_dsc->value_ofs_x = lv_obj_get_style_value_ofs_x(obj, part);
|
||||||
|
draw_dsc->value_ofs_y = lv_obj_get_style_value_ofs_y(obj, part);
|
||||||
|
draw_dsc->value_color = lv_obj_get_style_value_color(obj, part);
|
||||||
|
draw_dsc->value_font = lv_obj_get_style_value_font(obj, part);
|
||||||
|
draw_dsc->value_letter_space = lv_obj_get_style_value_letter_space(obj, part);
|
||||||
|
draw_dsc->value_line_space = lv_obj_get_style_value_line_space(obj, part);
|
||||||
|
draw_dsc->value_align = lv_obj_get_style_value_align(obj, part);
|
||||||
|
draw_dsc->value_blend_mode = lv_obj_get_style_value_blend_mode(obj, part);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2871,6 +2783,7 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
|||||||
draw_dsc->border_opa = (uint16_t)((uint16_t)draw_dsc->border_opa * opa_scale) >> 8;
|
draw_dsc->border_opa = (uint16_t)((uint16_t)draw_dsc->border_opa * opa_scale) >> 8;
|
||||||
draw_dsc->shadow_opa = (uint16_t)((uint16_t)draw_dsc->shadow_opa * opa_scale) >> 8;
|
draw_dsc->shadow_opa = (uint16_t)((uint16_t)draw_dsc->shadow_opa * opa_scale) >> 8;
|
||||||
draw_dsc->pattern_opa = (uint16_t)((uint16_t)draw_dsc->pattern_opa * opa_scale) >> 8;
|
draw_dsc->pattern_opa = (uint16_t)((uint16_t)draw_dsc->pattern_opa * opa_scale) >> 8;
|
||||||
|
draw_dsc->value_opa = (uint16_t)((uint16_t)draw_dsc->value_opa * opa_scale) >> 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3047,6 +2960,37 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param)
|
|||||||
obj->ext_draw_pad = LV_MATH_MAX(obj->ext_draw_pad, shadow);
|
obj->ext_draw_pad = LV_MATH_MAX(obj->ext_draw_pad, shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char * value_str = lv_obj_get_style_value_str(obj, LV_OBJ_PART_MAIN);
|
||||||
|
if(value_str) {
|
||||||
|
lv_style_int_t letter_space = lv_obj_get_style_value_letter_space(obj, LV_OBJ_PART_MAIN);
|
||||||
|
lv_style_int_t line_space = lv_obj_get_style_value_letter_space(obj, LV_OBJ_PART_MAIN);
|
||||||
|
const lv_font_t * font = lv_obj_get_style_value_font(obj, LV_OBJ_PART_MAIN);
|
||||||
|
|
||||||
|
lv_point_t s;
|
||||||
|
lv_txt_get_size(&s, value_str, font, letter_space, line_space, LV_COORD_MAX, LV_TXT_FLAG_NONE);
|
||||||
|
|
||||||
|
lv_area_t value_area;
|
||||||
|
value_area.x1 = 0;
|
||||||
|
value_area.y1 = 0;
|
||||||
|
value_area.x2 = s.x - 1;
|
||||||
|
value_area.y2 = s.y - 1;
|
||||||
|
|
||||||
|
lv_style_int_t align = lv_obj_get_style_value_align(obj, LV_OBJ_PART_MAIN);
|
||||||
|
lv_style_int_t xofs = lv_obj_get_style_value_ofs_x(obj, LV_OBJ_PART_MAIN);
|
||||||
|
lv_style_int_t yofs = lv_obj_get_style_value_ofs_y(obj, LV_OBJ_PART_MAIN);
|
||||||
|
lv_point_t p_align;
|
||||||
|
lv_area_align(&obj->coords, &value_area, align, &p_align);
|
||||||
|
|
||||||
|
value_area.x1 += p_align.x + xofs;
|
||||||
|
value_area.y1 += p_align.y + yofs;
|
||||||
|
value_area.x2 += p_align.x + xofs;
|
||||||
|
value_area.y2 += p_align.y + yofs;
|
||||||
|
|
||||||
|
obj->ext_draw_pad = LV_MATH_MAX(obj->ext_draw_pad, obj->coords.x1 - value_area.x1);
|
||||||
|
obj->ext_draw_pad = LV_MATH_MAX(obj->ext_draw_pad, obj->coords.y1 - value_area.y1);
|
||||||
|
obj->ext_draw_pad = LV_MATH_MAX(obj->ext_draw_pad, value_area.x2 - obj->coords.x2);
|
||||||
|
obj->ext_draw_pad = LV_MATH_MAX(obj->ext_draw_pad, value_area.y2 - obj->coords.y2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#if LV_USE_OBJ_REALIGN
|
#if LV_USE_OBJ_REALIGN
|
||||||
else if(sign == LV_SIGNAL_PARENT_SIZE_CHG) {
|
else if(sign == LV_SIGNAL_PARENT_SIZE_CHG) {
|
||||||
@@ -3259,3 +3203,4 @@ static void lv_event_mark_deleted(lv_obj_t * obj)
|
|||||||
t = t->prev;
|
t = t->prev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -151,32 +151,6 @@ typedef uint8_t lv_signal_t;
|
|||||||
|
|
||||||
typedef lv_res_t (*lv_signal_cb_t)(struct _lv_obj_t * obj, lv_signal_t sign, void * param);
|
typedef lv_res_t (*lv_signal_cb_t)(struct _lv_obj_t * obj, lv_signal_t sign, void * param);
|
||||||
|
|
||||||
/** Object alignment. */
|
|
||||||
enum {
|
|
||||||
LV_ALIGN_CENTER = 0,
|
|
||||||
LV_ALIGN_IN_TOP_LEFT,
|
|
||||||
LV_ALIGN_IN_TOP_MID,
|
|
||||||
LV_ALIGN_IN_TOP_RIGHT,
|
|
||||||
LV_ALIGN_IN_BOTTOM_LEFT,
|
|
||||||
LV_ALIGN_IN_BOTTOM_MID,
|
|
||||||
LV_ALIGN_IN_BOTTOM_RIGHT,
|
|
||||||
LV_ALIGN_IN_LEFT_MID,
|
|
||||||
LV_ALIGN_IN_RIGHT_MID,
|
|
||||||
LV_ALIGN_OUT_TOP_LEFT,
|
|
||||||
LV_ALIGN_OUT_TOP_MID,
|
|
||||||
LV_ALIGN_OUT_TOP_RIGHT,
|
|
||||||
LV_ALIGN_OUT_BOTTOM_LEFT,
|
|
||||||
LV_ALIGN_OUT_BOTTOM_MID,
|
|
||||||
LV_ALIGN_OUT_BOTTOM_RIGHT,
|
|
||||||
LV_ALIGN_OUT_LEFT_TOP,
|
|
||||||
LV_ALIGN_OUT_LEFT_MID,
|
|
||||||
LV_ALIGN_OUT_LEFT_BOTTOM,
|
|
||||||
LV_ALIGN_OUT_RIGHT_TOP,
|
|
||||||
LV_ALIGN_OUT_RIGHT_MID,
|
|
||||||
LV_ALIGN_OUT_RIGHT_BOTTOM,
|
|
||||||
};
|
|
||||||
typedef uint8_t lv_align_t;
|
|
||||||
|
|
||||||
#if LV_USE_OBJ_REALIGN
|
#if LV_USE_OBJ_REALIGN
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@@ -913,9 +887,9 @@ static inline value_type lv_obj_get_style_##func_name (const lv_obj_t * obj, uin
|
|||||||
{ \
|
{ \
|
||||||
return (value_type) lv_obj_get_style##style_type (obj, part, LV_STYLE_##prop_name); \
|
return (value_type) lv_obj_get_style##style_type (obj, part, LV_STYLE_##prop_name); \
|
||||||
} \
|
} \
|
||||||
static inline void lv_obj_set_style_##func_name (lv_obj_t * obj, uint8_t part, value_type value) \
|
static inline void lv_obj_set_style_##func_name (lv_obj_t * obj, uint8_t part, lv_style_state_t state, value_type value) \
|
||||||
{ \
|
{ \
|
||||||
lv_obj_set_style##style_type (obj, part, LV_STYLE_##prop_name, value); \
|
lv_obj_set_style##style_type (obj, part, LV_STYLE_##prop_name | state, value); \
|
||||||
} \
|
} \
|
||||||
static inline int16_t lv_style_get_##func_name (lv_style_t * style, void * res) \
|
static inline int16_t lv_style_get_##func_name (lv_style_t * style, void * res) \
|
||||||
{ \
|
{ \
|
||||||
@@ -956,18 +930,28 @@ LV_OBJ_STYLE_SET_GET_DECLARE(SHADOW_SPREAD, shadow_spread, lv_style_int_t, _int)
|
|||||||
LV_OBJ_STYLE_SET_GET_DECLARE(SHADOW_BLEND_MODE, shadow_blend_mode, lv_blend_mode_t, _int );
|
LV_OBJ_STYLE_SET_GET_DECLARE(SHADOW_BLEND_MODE, shadow_blend_mode, lv_blend_mode_t, _int );
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(SHADOW_COLOR, shadow_color, lv_color_t, _color);
|
LV_OBJ_STYLE_SET_GET_DECLARE(SHADOW_COLOR, shadow_color, lv_color_t, _color);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(SHADOW_OPA, shadow_opa, lv_opa_t, _opa);
|
LV_OBJ_STYLE_SET_GET_DECLARE(SHADOW_OPA, shadow_opa, lv_opa_t, _opa);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(PATTERN_REPEAT, pattern_repeat, lv_style_int_t, _int);
|
LV_OBJ_STYLE_SET_GET_DECLARE(PATTERN_BLEND_MODE, pattern_blend_mode, lv_blend_mode_t, _int );
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(PATTERN_RECOLOR, pattern_recolor, lv_color_t, _color);
|
LV_OBJ_STYLE_SET_GET_DECLARE(PATTERN_RECOLOR, pattern_recolor, lv_color_t, _color);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(PATTERN_OPA, pattern_opa, lv_opa_t, _opa);
|
LV_OBJ_STYLE_SET_GET_DECLARE(PATTERN_OPA, pattern_opa, lv_opa_t, _opa);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(PATTERN_RECOLOR_OPA, pattern_recolor_opa, lv_opa_t, _opa);
|
LV_OBJ_STYLE_SET_GET_DECLARE(PATTERN_RECOLOR_OPA, pattern_recolor_opa, lv_opa_t, _opa);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(PATTERN_IMAGE, pattern_image, const void *, _ptr);
|
LV_OBJ_STYLE_SET_GET_DECLARE(PATTERN_IMAGE, pattern_image, const void *, _ptr);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(LETTER_SPACE, letter_space, lv_style_int_t, _int);
|
LV_OBJ_STYLE_SET_GET_DECLARE(VALUE_LETTER_SPACE, value_letter_space, lv_style_int_t, _int);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(LINE_SPACE, line_space, lv_style_int_t, _int);
|
LV_OBJ_STYLE_SET_GET_DECLARE(VALUE_LINE_SPACE, value_line_space, lv_style_int_t, _int);
|
||||||
|
LV_OBJ_STYLE_SET_GET_DECLARE(VALUE_BLEND_MODE, value_blend_mode, lv_blend_mode_t, _int);
|
||||||
|
LV_OBJ_STYLE_SET_GET_DECLARE(VALUE_OFS_X, value_ofs_x, lv_style_int_t, _int);
|
||||||
|
LV_OBJ_STYLE_SET_GET_DECLARE(VALUE_OFS_Y, value_ofs_y, lv_style_int_t, _int);
|
||||||
|
LV_OBJ_STYLE_SET_GET_DECLARE(VALUE_ALIGN, value_align, lv_align_t, _int);
|
||||||
|
LV_OBJ_STYLE_SET_GET_DECLARE(VALUE_COLOR, value_color, lv_color_t, _color);
|
||||||
|
LV_OBJ_STYLE_SET_GET_DECLARE(VALUE_OPA, value_opa, lv_opa_t, _opa);
|
||||||
|
LV_OBJ_STYLE_SET_GET_DECLARE(VALUE_FONT, value_font, const lv_font_t * , _ptr);
|
||||||
|
LV_OBJ_STYLE_SET_GET_DECLARE(VALUE_STR, value_str, const char * , _ptr);
|
||||||
|
LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_LETTER_SPACE, letter_space, lv_style_int_t, _int);
|
||||||
|
LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_LINE_SPACE, line_space, lv_style_int_t, _int);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_BLEND_MODE, text_blend_mode, lv_blend_mode_t, _int);
|
LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_BLEND_MODE, text_blend_mode, lv_blend_mode_t, _int);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_COLOR, text_color, lv_color_t, _color);
|
LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_COLOR, text_color, lv_color_t, _color);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_SEL_COLOR, text_sel_color, lv_color_t, _color);
|
LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_SEL_COLOR, text_sel_color, lv_color_t, _color);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_OPA, text_opa, lv_opa_t, _opa);
|
LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_OPA, text_opa, lv_opa_t, _opa);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(FONT, font, const lv_font_t * , _ptr);
|
LV_OBJ_STYLE_SET_GET_DECLARE(TEXT_FONT, font, const lv_font_t * , _ptr);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(LINE_WIDTH, line_width, lv_style_int_t, _int);
|
LV_OBJ_STYLE_SET_GET_DECLARE(LINE_WIDTH, line_width, lv_style_int_t, _int);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(LINE_BLEND_MODE, line_blend_mode, lv_blend_mode_t, _int);
|
LV_OBJ_STYLE_SET_GET_DECLARE(LINE_BLEND_MODE, line_blend_mode, lv_blend_mode_t, _int);
|
||||||
LV_OBJ_STYLE_SET_GET_DECLARE(LINE_DASH_WIDTH, line_dash_width, lv_style_int_t, _int);
|
LV_OBJ_STYLE_SET_GET_DECLARE(LINE_DASH_WIDTH, line_dash_width, lv_style_int_t, _int);
|
||||||
|
|||||||
@@ -37,10 +37,6 @@
|
|||||||
**********************/
|
**********************/
|
||||||
static inline int32_t get_property_index(const lv_style_t * style, lv_style_property_t prop);
|
static inline int32_t get_property_index(const lv_style_t * style, lv_style_property_t prop);
|
||||||
static lv_style_t * get_local_style(lv_style_list_t * list);
|
static lv_style_t * get_local_style(lv_style_list_t * list);
|
||||||
#if LV_USE_ANIMATION
|
|
||||||
static void style_animator(lv_style_anim_dsc_t * dsc, lv_anim_value_t val);
|
|
||||||
static void style_animation_common_end_cb(lv_anim_t * a);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOABAL VARIABLES
|
* GLOABAL VARIABLES
|
||||||
@@ -613,39 +609,6 @@ lv_res_t lv_style_list_get_ptr(lv_style_list_t * list, lv_style_property_t prop,
|
|||||||
else return LV_RES_INV;
|
else return LV_RES_INV;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LV_USE_ANIMATION
|
|
||||||
|
|
||||||
void lv_style_anim_init(lv_anim_t * a)
|
|
||||||
{
|
|
||||||
lv_anim_init(a);
|
|
||||||
a->start = 0;
|
|
||||||
a->end = STYLE_MIX_MAX;
|
|
||||||
a->exec_cb = (lv_anim_exec_xcb_t)style_animator;
|
|
||||||
a->path_cb = lv_anim_path_linear;
|
|
||||||
a->ready_cb = style_animation_common_end_cb;
|
|
||||||
|
|
||||||
lv_style_anim_dsc_t * dsc;
|
|
||||||
|
|
||||||
dsc = lv_mem_alloc(sizeof(lv_style_anim_dsc_t));
|
|
||||||
LV_ASSERT_MEM(dsc);
|
|
||||||
if(dsc == NULL) return;
|
|
||||||
dsc->ready_cb = NULL;
|
|
||||||
dsc->style_anim = NULL;
|
|
||||||
lv_style_init(&dsc->style_start);
|
|
||||||
lv_style_init(&dsc->style_end);
|
|
||||||
|
|
||||||
a->var = (void *)dsc;
|
|
||||||
}
|
|
||||||
|
|
||||||
void lv_style_anim_set_styles(lv_anim_t * a, lv_style_t * to_anim, const lv_style_t * start, const lv_style_t * end)
|
|
||||||
{
|
|
||||||
lv_style_anim_dsc_t * dsc = a->var;
|
|
||||||
dsc->style_anim = to_anim;
|
|
||||||
|
|
||||||
lv_style_copy(&dsc->style_start, start);
|
|
||||||
lv_style_copy(&dsc->style_end, end);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC FUNCTIONS
|
* STATIC FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
@@ -716,109 +679,3 @@ static lv_style_t * get_local_style(lv_style_list_t * list)
|
|||||||
return local_style;
|
return local_style;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if LV_USE_ANIMATION
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used by the style animations to set the values of a style according to start and end style.
|
|
||||||
* @param dsc the 'animated variable' set by lv_style_anim_create()
|
|
||||||
* @param val the current state of the animation between 0 and LV_ANIM_RESOLUTION
|
|
||||||
*/
|
|
||||||
static void style_animator(lv_style_anim_dsc_t * dsc, lv_anim_value_t val)
|
|
||||||
{
|
|
||||||
const lv_style_t * start = &dsc->style_start;
|
|
||||||
const lv_style_t * end = &dsc->style_end;
|
|
||||||
lv_style_t * act = dsc->style_anim;
|
|
||||||
|
|
||||||
size_t i = 0;
|
|
||||||
lv_style_property_t prop_act;
|
|
||||||
while(start->map[i] != _LV_STYLE_CLOSEING_PROP) {
|
|
||||||
prop_act = start->map[i] + (start->map[i + 1] << 8);
|
|
||||||
|
|
||||||
/*Value*/
|
|
||||||
if((start->map[i] & 0xF) < LV_STYLE_ID_COLOR) {
|
|
||||||
lv_style_int_t v1;
|
|
||||||
memcpy(&v1, &start->map[i + sizeof(lv_style_property_t)], sizeof(lv_style_int_t));
|
|
||||||
|
|
||||||
int16_t res2;
|
|
||||||
lv_style_int_t v2;
|
|
||||||
res2 = lv_style_get_int(end, prop_act, &v2);
|
|
||||||
|
|
||||||
if(res2 >= 0) {
|
|
||||||
lv_style_int_t vres = v1 + ((int32_t)((int32_t)(v2-v1) * val) >> 8);
|
|
||||||
lv_style_set_int(act, prop_act, vres);
|
|
||||||
}
|
|
||||||
|
|
||||||
i+= sizeof(lv_style_int_t);
|
|
||||||
}
|
|
||||||
/*Color*/
|
|
||||||
else if((start->map[i] & 0xF) < LV_STYLE_ID_OPA) {
|
|
||||||
lv_color_t color1;
|
|
||||||
memcpy(&color1, &start->map[i + sizeof(lv_style_property_t)], sizeof(lv_color_t));
|
|
||||||
|
|
||||||
int16_t res2;
|
|
||||||
lv_color_t color2;
|
|
||||||
res2 = lv_style_get_color(end, prop_act, &color2);
|
|
||||||
|
|
||||||
if(res2 >= 0) {
|
|
||||||
lv_color_t color_res = val == 256 ? color2 : lv_color_mix(color2, color1, (lv_opa_t)val);
|
|
||||||
lv_style_set_color(act, prop_act, color_res);
|
|
||||||
}
|
|
||||||
|
|
||||||
i+= sizeof(lv_color_t);
|
|
||||||
}
|
|
||||||
/*Opa*/
|
|
||||||
else if((start->map[i] & 0xF) < LV_STYLE_ID_PTR) {
|
|
||||||
lv_opa_t opa1;
|
|
||||||
memcpy(&opa1, &start->map[i + sizeof(lv_style_property_t)], sizeof(lv_opa_t));
|
|
||||||
|
|
||||||
int16_t res2;
|
|
||||||
lv_opa_t opa2;
|
|
||||||
res2 = lv_style_get_opa(end, prop_act, &opa2);
|
|
||||||
|
|
||||||
if(res2 >= 0) {
|
|
||||||
lv_opa_t opa_res = opa1 + ((uint16_t)((uint16_t)(opa2 - opa1) * val) >> 8);
|
|
||||||
lv_style_set_opa(act, prop_act, opa_res);
|
|
||||||
}
|
|
||||||
|
|
||||||
i+= sizeof(lv_opa_t);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
void * p1;
|
|
||||||
memcpy(p1, &start->map[i + sizeof(lv_style_property_t)], sizeof(void *));
|
|
||||||
|
|
||||||
int16_t res2;
|
|
||||||
void * p2;
|
|
||||||
res2 = lv_style_get_ptr(end, prop_act, &p2);
|
|
||||||
|
|
||||||
if(res2 >= 0) {
|
|
||||||
if(val > 128) lv_style_set_ptr(act, prop_act, p2);
|
|
||||||
else if(val > 128) lv_style_set_ptr(act, prop_act, p1);
|
|
||||||
}
|
|
||||||
|
|
||||||
i+= sizeof(void*);
|
|
||||||
}
|
|
||||||
|
|
||||||
i += sizeof(lv_style_property_t);
|
|
||||||
}
|
|
||||||
|
|
||||||
lv_obj_report_style_mod(dsc->style_anim);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when a style animation is ready
|
|
||||||
* It called the user defined call back and free the allocated memories
|
|
||||||
* @param a pointer to the animation
|
|
||||||
*/
|
|
||||||
static void style_animation_common_end_cb(lv_anim_t * a)
|
|
||||||
{
|
|
||||||
|
|
||||||
(void)a; /*Unused*/
|
|
||||||
lv_style_anim_dsc_t * dsc = a->var; /*To avoid casting*/
|
|
||||||
|
|
||||||
if(dsc->ready_cb) dsc->ready_cb(a);
|
|
||||||
|
|
||||||
lv_mem_free(dsc);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -110,41 +110,51 @@ enum {
|
|||||||
LV_STYLE_PROP_INIT(LV_STYLE_SHADOW_COLOR, 0x4, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_SHADOW_COLOR, 0x4, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_SHADOW_OPA, 0x4, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_SHADOW_OPA, 0x4, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_NONE),
|
||||||
|
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_REPEAT, 0x5, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_BLEND_MODE, 0x5, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_BLEND_MODE, 0x5, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_NONE),
|
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_RECOLOR, 0x5, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_RECOLOR, 0x5, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_OPA, 0x5, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_OPA, 0x5, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_RECOLOR_OPA, 0x5, LV_STYLE_ID_OPA + 1, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_RECOLOR_OPA, 0x5, LV_STYLE_ID_OPA + 1, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_IMAGE, 0x5, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_IMAGE, 0x5, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_NONE),
|
||||||
|
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_LETTER_SPACE, 0x6, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_INHERIT),
|
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_LETTER_SPACE, 0x6, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_LINE_SPACE, 0x6, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_INHERIT),
|
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_LINE_SPACE, 0x6, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_BLEND_MODE, 0x6, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_INHERIT),
|
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_BLEND_MODE, 0x6, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_COLOR, 0x6, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_INHERIT),
|
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_OFS_X, 0x6, LV_STYLE_ID_VALUE + 3, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_SEL_COLOR, 0x6, LV_STYLE_ID_COLOR + 1, LV_STYLE_ATTR_INHERIT),
|
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_OFS_Y, 0x6, LV_STYLE_ID_VALUE + 4, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_OPA, 0x6, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_INHERIT),
|
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_ALIGN, 0x6, LV_STYLE_ID_VALUE + 5, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_FONT, 0x6, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_INHERIT),
|
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_COLOR, 0x6, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_NONE),
|
||||||
|
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_OPA, 0x6, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_NONE),
|
||||||
|
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_FONT, 0x6, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_NONE),
|
||||||
|
LV_STYLE_PROP_INIT(LV_STYLE_VALUE_STR, 0x6, LV_STYLE_ID_PTR + 1, LV_STYLE_ATTR_NONE),
|
||||||
|
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_LINE_WIDTH, 0x7, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LETTER_SPACE, 0x7, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_INHERIT),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_LINE_BLEND_MODE, 0x7, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_LINE_SPACE, 0x7, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_INHERIT),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_LINE_DASH_WIDTH, 0x7, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_BLEND_MODE, 0x7, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_INHERIT),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_LINE_DASH_GAP, 0x7, LV_STYLE_ID_VALUE + 3, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_COLOR, 0x7, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_INHERIT),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_LINE_ROUNDED, 0x7, LV_STYLE_ID_VALUE + 4, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_SEL_COLOR, 0x7, LV_STYLE_ID_COLOR + 1, LV_STYLE_ATTR_INHERIT),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_LINE_COLOR, 0x7, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_OPA, 0x7, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_INHERIT),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_LINE_OPA, 0x7, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_TEXT_FONT, 0x7, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_INHERIT),
|
||||||
|
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_IMAGE_BLEND_MODE, 0x8, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_INHERIT),
|
LV_STYLE_PROP_INIT(LV_STYLE_LINE_WIDTH, 0x8, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_IMAGE_RECOLOR, 0x8, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_INHERIT),
|
LV_STYLE_PROP_INIT(LV_STYLE_LINE_BLEND_MODE, 0x8, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_IMAGE_OPA, 0x8, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_INHERIT),
|
LV_STYLE_PROP_INIT(LV_STYLE_LINE_DASH_WIDTH, 0x8, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_IMAGE_RECOLOR_OPA, 0x8, LV_STYLE_ID_OPA + 1, LV_STYLE_ATTR_INHERIT),
|
LV_STYLE_PROP_INIT(LV_STYLE_LINE_DASH_GAP, 0x8, LV_STYLE_ID_VALUE + 3, LV_STYLE_ATTR_NONE),
|
||||||
|
LV_STYLE_PROP_INIT(LV_STYLE_LINE_ROUNDED, 0x8, LV_STYLE_ID_VALUE + 4, LV_STYLE_ATTR_NONE),
|
||||||
|
LV_STYLE_PROP_INIT(LV_STYLE_LINE_COLOR, 0x8, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_NONE),
|
||||||
|
LV_STYLE_PROP_INIT(LV_STYLE_LINE_OPA, 0x8, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_NONE),
|
||||||
|
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_SIZE, 0x9, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_IMAGE_BLEND_MODE, 0x9, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_INHERIT),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_SCALE_WIDTH, 0x9, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_IMAGE_RECOLOR, 0x9, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_INHERIT),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_SCALE_BORDER_WIDTH, 0x9, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_IMAGE_OPA, 0x9, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_INHERIT),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_SCALE_END_BORDER_WIDTH, 0x9, LV_STYLE_ID_VALUE + 3, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_IMAGE_RECOLOR_OPA, 0x9, LV_STYLE_ID_OPA + 1, LV_STYLE_ATTR_INHERIT),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_SCALE_COLOR, 0x9, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_NONE),
|
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_SCALE_GRAD_COLOR, 0x9, LV_STYLE_ID_COLOR + 1, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_SIZE, 0xA, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_NONE),
|
||||||
LV_STYLE_PROP_INIT(LV_STYLE_SCALE_END_COLOR, 0x9, LV_STYLE_ID_COLOR + 2, LV_STYLE_ATTR_NONE),
|
LV_STYLE_PROP_INIT(LV_STYLE_SCALE_WIDTH, 0xA, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_NONE),
|
||||||
|
LV_STYLE_PROP_INIT(LV_STYLE_SCALE_BORDER_WIDTH, 0xA, LV_STYLE_ID_VALUE + 2, LV_STYLE_ATTR_NONE),
|
||||||
|
LV_STYLE_PROP_INIT(LV_STYLE_SCALE_END_BORDER_WIDTH, 0xA, LV_STYLE_ID_VALUE + 3, LV_STYLE_ATTR_NONE),
|
||||||
|
LV_STYLE_PROP_INIT(LV_STYLE_SCALE_COLOR, 0xA, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_NONE),
|
||||||
|
LV_STYLE_PROP_INIT(LV_STYLE_SCALE_GRAD_COLOR, 0xA, LV_STYLE_ID_COLOR + 1, LV_STYLE_ATTR_NONE),
|
||||||
|
LV_STYLE_PROP_INIT(LV_STYLE_SCALE_END_COLOR, 0xA, LV_STYLE_ID_COLOR + 2, LV_STYLE_ATTR_NONE),
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef uint16_t lv_style_property_t;
|
typedef uint16_t lv_style_property_t;
|
||||||
@@ -160,7 +170,6 @@ enum {
|
|||||||
LV_STYLE_STATE_HOVER = (1 << (3 + LV_STYLE_STATE_POS)),
|
LV_STYLE_STATE_HOVER = (1 << (3 + LV_STYLE_STATE_POS)),
|
||||||
LV_STYLE_STATE_PRESSED = (1 << (4 + LV_STYLE_STATE_POS)),
|
LV_STYLE_STATE_PRESSED = (1 << (4 + LV_STYLE_STATE_POS)),
|
||||||
LV_STYLE_STATE_DISABLED = (1 << (6 + LV_STYLE_STATE_POS)),
|
LV_STYLE_STATE_DISABLED = (1 << (6 + LV_STYLE_STATE_POS)),
|
||||||
LV_STYLE_STATE_ALL = (0x7F << LV_STYLE_STATE_POS),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef uint16_t lv_style_state_t;
|
typedef uint16_t lv_style_state_t;
|
||||||
@@ -178,19 +187,6 @@ typedef struct {
|
|||||||
uint8_t has_local :1;
|
uint8_t has_local :1;
|
||||||
}lv_style_list_t;
|
}lv_style_list_t;
|
||||||
|
|
||||||
#if LV_USE_ANIMATION
|
|
||||||
/** Data structure for style animations. */
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
lv_style_t style_start; /* Save not only pointers because can be same as 'style_anim' and
|
|
||||||
then it would be modified too*/
|
|
||||||
lv_style_t style_end;
|
|
||||||
lv_style_t * style_anim;
|
|
||||||
lv_style_property_t * prop_list;
|
|
||||||
lv_anim_ready_cb_t ready_cb;
|
|
||||||
} lv_style_anim_dsc_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOBAL PROTOTYPES
|
* GLOBAL PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uin
|
|||||||
|
|
||||||
/*Draw a full ring*/
|
/*Draw a full ring*/
|
||||||
if(start_angle + 360 == end_angle) {
|
if(start_angle + 360 == end_angle) {
|
||||||
lv_draw_rect(&area, clip_area, &circle_style, opa_scale);
|
lv_draw_rect(&area, clip_area, dsc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ static void draw_shadow(const lv_area_t * coords, const lv_area_t * clip, lv_dra
|
|||||||
static inline lv_color_t grad_get(lv_draw_rect_dsc_t * dsc, lv_coord_t s, lv_coord_t i);
|
static inline lv_color_t grad_get(lv_draw_rect_dsc_t * dsc, lv_coord_t s, lv_coord_t i);
|
||||||
static void shadow_draw_corner_buf(const lv_area_t * coords, uint16_t * sh_buf, lv_coord_t s, lv_coord_t r);
|
static void shadow_draw_corner_buf(const lv_area_t * coords, uint16_t * sh_buf, lv_coord_t s, lv_coord_t r);
|
||||||
static void shadow_blur_corner(lv_coord_t size, lv_coord_t sw, uint16_t * sh_ups_buf);
|
static void shadow_blur_corner(lv_coord_t size, lv_coord_t sw, uint16_t * sh_ups_buf);
|
||||||
static void draw_img(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
|
static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
|
||||||
|
static void draw_value(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC VARIABLES
|
* STATIC VARIABLES
|
||||||
@@ -54,11 +55,15 @@ void lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc)
|
|||||||
dsc->bg_grad_color = LV_COLOR_BLACK;
|
dsc->bg_grad_color = LV_COLOR_BLACK;
|
||||||
dsc->border_color = LV_COLOR_BLACK;
|
dsc->border_color = LV_COLOR_BLACK;
|
||||||
dsc->pattern_recolor = LV_COLOR_BLACK;
|
dsc->pattern_recolor = LV_COLOR_BLACK;
|
||||||
|
dsc->value_color = LV_COLOR_BLACK;
|
||||||
dsc->shadow_color = LV_COLOR_BLACK;
|
dsc->shadow_color = LV_COLOR_BLACK;
|
||||||
dsc->bg_grad_color_stop = 0xFF;
|
dsc->bg_grad_color_stop = 0xFF;
|
||||||
dsc->bg_opa = LV_OPA_COVER;
|
dsc->bg_opa = LV_OPA_COVER;
|
||||||
dsc->border_opa = LV_OPA_COVER;
|
dsc->border_opa = LV_OPA_COVER;
|
||||||
|
dsc->pattern_opa = LV_OPA_COVER;
|
||||||
dsc->pattern_font = LV_FONT_DEFAULT;
|
dsc->pattern_font = LV_FONT_DEFAULT;
|
||||||
|
dsc->value_opa = LV_OPA_COVER;
|
||||||
|
dsc->value_font = LV_FONT_DEFAULT;
|
||||||
dsc->shadow_opa = LV_OPA_COVER;
|
dsc->shadow_opa = LV_OPA_COVER;
|
||||||
dsc->border_side = LV_BORDER_SIDE_FULL;
|
dsc->border_side = LV_BORDER_SIDE_FULL;
|
||||||
|
|
||||||
@@ -76,8 +81,9 @@ void lv_draw_rect(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect
|
|||||||
|
|
||||||
draw_shadow(coords, clip, dsc);
|
draw_shadow(coords, clip, dsc);
|
||||||
draw_bg(coords, clip, dsc);
|
draw_bg(coords, clip, dsc);
|
||||||
draw_img(coords, clip, dsc);
|
draw_pattern(coords, clip, dsc);
|
||||||
draw_border(coords, clip, dsc);
|
draw_border(coords, clip, dsc);
|
||||||
|
draw_value(coords, clip, dsc);
|
||||||
|
|
||||||
LV_ASSERT_MEM_INTEGRITY();
|
LV_ASSERT_MEM_INTEGRITY();
|
||||||
}
|
}
|
||||||
@@ -1043,7 +1049,7 @@ static void shadow_blur_corner(lv_coord_t size, lv_coord_t sw, uint16_t * sh_ups
|
|||||||
lv_mem_buf_release(sh_ups_blur_buf);
|
lv_mem_buf_release(sh_ups_blur_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_img(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc)
|
static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc)
|
||||||
{
|
{
|
||||||
if(dsc->pattern_image == NULL) return;
|
if(dsc->pattern_image == NULL) return;
|
||||||
if(dsc->pattern_opa <= LV_OPA_MIN) return;
|
if(dsc->pattern_opa <= LV_OPA_MIN) return;
|
||||||
@@ -1090,7 +1096,6 @@ static void draw_img(const lv_area_t * coords, const lv_area_t * clip, lv_draw_r
|
|||||||
|
|
||||||
lv_area_t coords_tmp;
|
lv_area_t coords_tmp;
|
||||||
|
|
||||||
if(dsc->pattern_repeate) {
|
|
||||||
lv_draw_mask_radius_param_t radius_mask_param;
|
lv_draw_mask_radius_param_t radius_mask_param;
|
||||||
lv_draw_mask_radius_init(&radius_mask_param, coords, dsc->radius, false);
|
lv_draw_mask_radius_init(&radius_mask_param, coords, dsc->radius, false);
|
||||||
int16_t radius_mask_id = lv_draw_mask_add(&radius_mask_param, NULL);
|
int16_t radius_mask_id = lv_draw_mask_add(&radius_mask_param, NULL);
|
||||||
@@ -1110,34 +1115,39 @@ static void draw_img(const lv_area_t * coords, const lv_area_t * clip, lv_draw_r
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
lv_draw_mask_remove_id(radius_mask_id);
|
lv_draw_mask_remove_id(radius_mask_id);
|
||||||
} else {
|
|
||||||
int32_t obj_w = lv_area_get_width(coords);
|
|
||||||
int32_t obj_h = lv_area_get_height(coords);
|
|
||||||
coords_tmp.x1 = coords->x1 + (obj_w - img_w) / 2;
|
|
||||||
coords_tmp.y1 = coords->y1 + (obj_h - img_h) / 2;
|
|
||||||
coords_tmp.x2 = coords_tmp.x1 + img_w - 1;
|
|
||||||
coords_tmp.y2 = coords_tmp.y1 + img_h - 1;
|
|
||||||
|
|
||||||
/* If the (obj_h - img_h) is odd there is a rounding error when divided by 2.
|
|
||||||
* It's better round up in case of symbols because probably there is some extra space in the bottom
|
|
||||||
* due to the base line of font*/
|
|
||||||
if(src_type == LV_IMG_SRC_SYMBOL) {
|
|
||||||
int32_t y_corr = (obj_h - img_h) & 0x1;
|
|
||||||
coords_tmp.y1 += y_corr;
|
|
||||||
coords_tmp.y2 += y_corr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t radius_mask_id = LV_MASK_ID_INV;
|
|
||||||
if(lv_area_is_in(&coords_tmp, coords, dsc->radius) == false) {
|
static void draw_value(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc)
|
||||||
lv_draw_mask_radius_param_t radius_mask_param;
|
{
|
||||||
lv_draw_mask_radius_init(&radius_mask_param, coords, dsc->radius, false);
|
if(dsc->value_str == NULL) return;
|
||||||
radius_mask_id = lv_draw_mask_add(&radius_mask_param, NULL);
|
if(dsc->value_opa <= LV_OPA_MIN) return;
|
||||||
}
|
|
||||||
|
lv_point_t s;
|
||||||
if(src_type == LV_IMG_SRC_SYMBOL) lv_draw_label(&coords_tmp, clip, &label_dsc, dsc->pattern_image, NULL);
|
lv_txt_get_size(&s, dsc->value_str, dsc->value_font, dsc->value_letter_space, dsc->value_line_space, LV_COORD_MAX, LV_TXT_FLAG_NONE);
|
||||||
else lv_draw_img(&coords_tmp, clip, dsc->pattern_image, &img_dsc);
|
|
||||||
|
lv_area_t value_area;
|
||||||
lv_draw_mask_remove_id(radius_mask_id);
|
value_area.x1 = 0;
|
||||||
}
|
value_area.y1 = 0;
|
||||||
|
value_area.x2 = s.x - 1;
|
||||||
|
value_area.y2 = s.y - 1;
|
||||||
|
|
||||||
|
lv_point_t p_align;
|
||||||
|
lv_area_align(coords, &value_area, dsc->value_align, &p_align);
|
||||||
|
|
||||||
|
value_area.x1 += p_align.x + dsc->value_ofs_x;
|
||||||
|
value_area.y1 += p_align.y + dsc->value_ofs_y;
|
||||||
|
value_area.x2 += p_align.x + dsc->value_ofs_x;
|
||||||
|
value_area.y2 += p_align.y + dsc->value_ofs_y;
|
||||||
|
|
||||||
|
lv_draw_label_dsc_t label_dsc;
|
||||||
|
lv_draw_label_dsc_init(&label_dsc);
|
||||||
|
label_dsc.font = dsc->value_font;
|
||||||
|
label_dsc.letter_space = dsc->value_letter_space;
|
||||||
|
label_dsc.line_space = dsc->value_line_space;
|
||||||
|
label_dsc.color = dsc->value_color;
|
||||||
|
label_dsc.opa = dsc->value_opa;
|
||||||
|
|
||||||
|
lv_draw_label(&value_area, clip, &label_dsc, dsc->value_str, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ typedef struct {
|
|||||||
lv_style_int_t shadow_ofs_x;
|
lv_style_int_t shadow_ofs_x;
|
||||||
lv_style_int_t shadow_ofs_y;
|
lv_style_int_t shadow_ofs_y;
|
||||||
lv_style_int_t shadow_spread;
|
lv_style_int_t shadow_spread;
|
||||||
lv_style_int_t shadow_blend_mode;
|
lv_blend_mode_t shadow_blend_mode;
|
||||||
lv_opa_t shadow_opa;
|
lv_opa_t shadow_opa;
|
||||||
|
|
||||||
/*Pattern*/
|
/*Pattern*/
|
||||||
@@ -58,8 +58,19 @@ typedef struct {
|
|||||||
lv_opa_t pattern_opa;
|
lv_opa_t pattern_opa;
|
||||||
lv_opa_t pattern_recolor_opa;
|
lv_opa_t pattern_recolor_opa;
|
||||||
lv_color_t pattern_recolor;
|
lv_color_t pattern_recolor;
|
||||||
uint8_t pattern_repeate :1;
|
lv_blend_mode_t pattern_blend_mode;
|
||||||
|
|
||||||
|
/*Value*/
|
||||||
|
const char * value_str;
|
||||||
|
const lv_font_t * value_font;
|
||||||
|
lv_opa_t value_opa;
|
||||||
|
lv_color_t value_color;
|
||||||
|
lv_style_int_t value_ofs_x;
|
||||||
|
lv_style_int_t value_ofs_y;
|
||||||
|
lv_style_int_t value_letter_space;
|
||||||
|
lv_style_int_t value_line_space;
|
||||||
|
lv_align_t value_align;
|
||||||
|
lv_blend_mode_t value_blend_mode;
|
||||||
}lv_draw_rect_dsc_t;
|
}lv_draw_rect_dsc_t;
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -273,6 +273,125 @@ void lv_area_increment(lv_area_t * a_p, const lv_coord_t amount)
|
|||||||
a_p->y2 += amount;
|
a_p->y2 += amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Align an area to an other
|
||||||
|
* @param base an are where the other will be aligned
|
||||||
|
* @param to_align the area to align
|
||||||
|
* @param align `LV_ALIGN_...`
|
||||||
|
* @param res x/y coordinates where `to_align` align area should be placed
|
||||||
|
*/
|
||||||
|
void lv_area_align(const lv_area_t * base, const lv_area_t * to_align, lv_align_t align, lv_point_t * res)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch(align) {
|
||||||
|
case LV_ALIGN_CENTER:
|
||||||
|
res->x = lv_area_get_width(base) / 2 - lv_area_get_width(to_align) / 2;
|
||||||
|
res->y = lv_area_get_height(base) / 2 - lv_area_get_height(to_align) / 2;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_IN_TOP_LEFT:
|
||||||
|
res->x = 0;
|
||||||
|
res->y = 0;
|
||||||
|
break;
|
||||||
|
case LV_ALIGN_IN_TOP_MID:
|
||||||
|
res->x = lv_area_get_width(base) / 2 - lv_area_get_width(to_align) / 2;
|
||||||
|
res->y = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_IN_TOP_RIGHT:
|
||||||
|
res->x = lv_area_get_width(base) - lv_area_get_width(to_align);
|
||||||
|
res->y = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_IN_BOTTOM_LEFT:
|
||||||
|
res->x = 0;
|
||||||
|
res->y = lv_area_get_height(base) - lv_area_get_height(to_align);
|
||||||
|
break;
|
||||||
|
case LV_ALIGN_IN_BOTTOM_MID:
|
||||||
|
res->x = lv_area_get_width(base) / 2 - lv_area_get_width(to_align) / 2;
|
||||||
|
res->y = lv_area_get_height(base) - lv_area_get_height(to_align);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_IN_BOTTOM_RIGHT:
|
||||||
|
res->x = lv_area_get_width(base) - lv_area_get_width(to_align);
|
||||||
|
res->y = lv_area_get_height(base) - lv_area_get_height(to_align);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_IN_LEFT_MID:
|
||||||
|
res->x = 0;
|
||||||
|
res->y = lv_area_get_height(base) / 2 - lv_area_get_height(to_align) / 2;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_IN_RIGHT_MID:
|
||||||
|
res->x = lv_area_get_width(base) - lv_area_get_width(to_align);
|
||||||
|
res->y = lv_area_get_height(base) / 2 - lv_area_get_height(to_align) / 2;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_OUT_TOP_LEFT:
|
||||||
|
res->x = 0;
|
||||||
|
res->y = -lv_area_get_height(to_align);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_OUT_TOP_MID:
|
||||||
|
res->x = lv_area_get_width(base) / 2 - lv_area_get_width(to_align) / 2;
|
||||||
|
res->y = -lv_area_get_height(to_align);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_OUT_TOP_RIGHT:
|
||||||
|
res->x = lv_area_get_width(base) - lv_area_get_width(to_align);
|
||||||
|
res->y = -lv_area_get_height(to_align);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_OUT_BOTTOM_LEFT:
|
||||||
|
res->x = 0;
|
||||||
|
res->y = lv_area_get_height(base);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_OUT_BOTTOM_MID:
|
||||||
|
res->x = lv_area_get_width(base) / 2 - lv_area_get_width(to_align) / 2;
|
||||||
|
res->y = lv_area_get_height(base);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_OUT_BOTTOM_RIGHT:
|
||||||
|
res->x = lv_area_get_width(base) - lv_area_get_width(to_align);
|
||||||
|
res->y = lv_area_get_height(base);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_OUT_LEFT_TOP:
|
||||||
|
res->x = -lv_area_get_width(to_align);
|
||||||
|
res->y = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_OUT_LEFT_MID:
|
||||||
|
res->x = -lv_area_get_width(to_align);
|
||||||
|
res->y = lv_area_get_height(base) / 2 - lv_area_get_height(to_align) / 2;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_OUT_LEFT_BOTTOM:
|
||||||
|
res->x = -lv_area_get_width(to_align);
|
||||||
|
res->y = lv_area_get_height(base) - lv_area_get_height(to_align);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_OUT_RIGHT_TOP:
|
||||||
|
res->x = lv_area_get_width(base);
|
||||||
|
res->y = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_OUT_RIGHT_MID:
|
||||||
|
res->x = lv_area_get_width(base);
|
||||||
|
res->y = lv_area_get_height(base) / 2 - lv_area_get_height(to_align) / 2;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LV_ALIGN_OUT_RIGHT_BOTTOM:
|
||||||
|
res->x = lv_area_get_width(base);
|
||||||
|
res->y = lv_area_get_height(base) - lv_area_get_height(to_align);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
res->x += base->x1;
|
||||||
|
res->y += base->y1;
|
||||||
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC FUNCTIONS
|
* STATIC FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
@@ -50,6 +50,35 @@ typedef struct
|
|||||||
lv_coord_t y2;
|
lv_coord_t y2;
|
||||||
} lv_area_t;
|
} lv_area_t;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** Alignments */
|
||||||
|
enum {
|
||||||
|
LV_ALIGN_CENTER = 0,
|
||||||
|
LV_ALIGN_IN_TOP_LEFT,
|
||||||
|
LV_ALIGN_IN_TOP_MID,
|
||||||
|
LV_ALIGN_IN_TOP_RIGHT,
|
||||||
|
LV_ALIGN_IN_BOTTOM_LEFT,
|
||||||
|
LV_ALIGN_IN_BOTTOM_MID,
|
||||||
|
LV_ALIGN_IN_BOTTOM_RIGHT,
|
||||||
|
LV_ALIGN_IN_LEFT_MID,
|
||||||
|
LV_ALIGN_IN_RIGHT_MID,
|
||||||
|
LV_ALIGN_OUT_TOP_LEFT,
|
||||||
|
LV_ALIGN_OUT_TOP_MID,
|
||||||
|
LV_ALIGN_OUT_TOP_RIGHT,
|
||||||
|
LV_ALIGN_OUT_BOTTOM_LEFT,
|
||||||
|
LV_ALIGN_OUT_BOTTOM_MID,
|
||||||
|
LV_ALIGN_OUT_BOTTOM_RIGHT,
|
||||||
|
LV_ALIGN_OUT_LEFT_TOP,
|
||||||
|
LV_ALIGN_OUT_LEFT_MID,
|
||||||
|
LV_ALIGN_OUT_LEFT_BOTTOM,
|
||||||
|
LV_ALIGN_OUT_RIGHT_TOP,
|
||||||
|
LV_ALIGN_OUT_RIGHT_MID,
|
||||||
|
LV_ALIGN_OUT_RIGHT_BOTTOM,
|
||||||
|
};
|
||||||
|
typedef uint8_t lv_align_t;
|
||||||
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOBAL PROTOTYPES
|
* GLOBAL PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
@@ -173,6 +202,14 @@ bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, lv_coor
|
|||||||
*/
|
*/
|
||||||
void lv_area_increment(lv_area_t * a_p, const lv_coord_t amount);
|
void lv_area_increment(lv_area_t * a_p, const lv_coord_t amount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Align an area to an other
|
||||||
|
* @param base an are where the other will be aligned
|
||||||
|
* @param to_align the area to align
|
||||||
|
* @param align `LV_ALIGN_...`
|
||||||
|
* @param res x/y coordinates where `to_align` align area should be placed
|
||||||
|
*/
|
||||||
|
void lv_area_align(const lv_area_t * base, const lv_area_t * to_align, lv_align_t align, lv_point_t * res);
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
@@ -511,13 +511,16 @@ static void draw_indic(lv_obj_t * bar, const lv_area_t * clip_area)
|
|||||||
(!hor && lv_area_get_height(&ext->indic_area) > bg_radius * 2)) {
|
(!hor && lv_area_get_height(&ext->indic_area) > bg_radius * 2)) {
|
||||||
lv_opa_t bg_opa = draw_indic_dsc.bg_opa;
|
lv_opa_t bg_opa = draw_indic_dsc.bg_opa;
|
||||||
lv_opa_t border_opa = draw_indic_dsc.border_opa;
|
lv_opa_t border_opa = draw_indic_dsc.border_opa;
|
||||||
|
lv_opa_t value_opa = draw_indic_dsc.border_opa;
|
||||||
void * pattern_src = draw_indic_dsc.pattern_image;
|
void * pattern_src = draw_indic_dsc.pattern_image;
|
||||||
draw_indic_dsc.bg_opa = LV_OPA_TRANSP;
|
draw_indic_dsc.bg_opa = LV_OPA_TRANSP;
|
||||||
draw_indic_dsc.border_opa = LV_OPA_TRANSP;
|
draw_indic_dsc.border_opa = LV_OPA_TRANSP;
|
||||||
|
draw_indic_dsc.value_opa = LV_OPA_TRANSP;
|
||||||
draw_indic_dsc.pattern_image = NULL;
|
draw_indic_dsc.pattern_image = NULL;
|
||||||
lv_draw_rect(&ext->indic_area, clip_area, &draw_indic_dsc);
|
lv_draw_rect(&ext->indic_area, clip_area, &draw_indic_dsc);
|
||||||
draw_indic_dsc.bg_opa = bg_opa;
|
draw_indic_dsc.bg_opa = bg_opa;
|
||||||
draw_indic_dsc.border_opa = border_opa;
|
draw_indic_dsc.border_opa = border_opa;
|
||||||
|
draw_indic_dsc.value_opa = value_opa;
|
||||||
draw_indic_dsc.pattern_image = pattern_src;
|
draw_indic_dsc.pattern_image = pattern_src;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -526,11 +529,13 @@ static void draw_indic(lv_obj_t * bar, const lv_area_t * clip_area)
|
|||||||
lv_draw_mask_radius_init(&mask_bg_param, &bar->coords, bg_radius, false);
|
lv_draw_mask_radius_init(&mask_bg_param, &bar->coords, bg_radius, false);
|
||||||
int16_t mask_bg_id = lv_draw_mask_add(&mask_bg_param, NULL);
|
int16_t mask_bg_id = lv_draw_mask_add(&mask_bg_param, NULL);
|
||||||
|
|
||||||
/*Draw_only the background*/
|
/*Draw_only the background and the pattern*/
|
||||||
lv_opa_t shadow_opa = draw_indic_dsc.shadow_opa;
|
lv_opa_t shadow_opa = draw_indic_dsc.shadow_opa;
|
||||||
lv_opa_t border_opa = draw_indic_dsc.border_opa;
|
lv_opa_t border_opa = draw_indic_dsc.border_opa;
|
||||||
|
lv_opa_t value_opa = draw_indic_dsc.value_opa;
|
||||||
draw_indic_dsc.border_opa = LV_OPA_TRANSP;
|
draw_indic_dsc.border_opa = LV_OPA_TRANSP;
|
||||||
draw_indic_dsc.shadow_opa = LV_OPA_TRANSP;
|
draw_indic_dsc.shadow_opa = LV_OPA_TRANSP;
|
||||||
|
draw_indic_dsc.value_opa = LV_OPA_TRANSP;
|
||||||
|
|
||||||
/*Get the max possible indicator area. The gradient should be applied on this*/
|
/*Get the max possible indicator area. The gradient should be applied on this*/
|
||||||
lv_area_t mask_indic_max_area;
|
lv_area_t mask_indic_max_area;
|
||||||
@@ -555,8 +560,9 @@ static void draw_indic(lv_obj_t * bar, const lv_area_t * clip_area)
|
|||||||
lv_draw_rect(&mask_indic_max_area, clip_area, &draw_indic_dsc);
|
lv_draw_rect(&mask_indic_max_area, clip_area, &draw_indic_dsc);
|
||||||
draw_indic_dsc.border_opa = border_opa;
|
draw_indic_dsc.border_opa = border_opa;
|
||||||
draw_indic_dsc.shadow_opa = shadow_opa;
|
draw_indic_dsc.shadow_opa = shadow_opa;
|
||||||
|
draw_indic_dsc.value_opa = value_opa;
|
||||||
|
|
||||||
/*Draw the border*/
|
/*Draw the border and the value*/
|
||||||
draw_indic_dsc.bg_opa = LV_OPA_TRANSP;
|
draw_indic_dsc.bg_opa = LV_OPA_TRANSP;
|
||||||
draw_indic_dsc.shadow_opa = LV_OPA_TRANSP;
|
draw_indic_dsc.shadow_opa = LV_OPA_TRANSP;
|
||||||
draw_indic_dsc.pattern_image = NULL;
|
draw_indic_dsc.pattern_image = NULL;
|
||||||
|
|||||||
@@ -383,6 +383,39 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
|
|||||||
slider->ext_draw_pad = LV_MATH_MAX(slider->ext_draw_pad, indic_size);
|
slider->ext_draw_pad = LV_MATH_MAX(slider->ext_draw_pad, indic_size);
|
||||||
slider->ext_draw_pad = LV_MATH_MAX(slider->ext_draw_pad, bg_size);
|
slider->ext_draw_pad = LV_MATH_MAX(slider->ext_draw_pad, bg_size);
|
||||||
|
|
||||||
|
/*The value string(s) can be out of the slider*/
|
||||||
|
const char * value_str = lv_obj_get_style_value_str(slider, LV_SLIDER_PART_KNOB);
|
||||||
|
if(value_str) {
|
||||||
|
lv_style_int_t letter_space = lv_obj_get_style_value_letter_space(slider, LV_SLIDER_PART_KNOB);
|
||||||
|
lv_style_int_t line_space = lv_obj_get_style_value_letter_space(slider, LV_SLIDER_PART_KNOB);
|
||||||
|
const lv_font_t * font = lv_obj_get_style_value_font(slider, LV_SLIDER_PART_KNOB);
|
||||||
|
|
||||||
|
lv_point_t s;
|
||||||
|
lv_txt_get_size(&s, value_str, font, letter_space, line_space, LV_COORD_MAX, LV_TXT_FLAG_NONE);
|
||||||
|
|
||||||
|
lv_area_t value_area;
|
||||||
|
value_area.x1 = 0;
|
||||||
|
value_area.y1 = 0;
|
||||||
|
value_area.x2 = s.x - 1;
|
||||||
|
value_area.y2 = s.y - 1;
|
||||||
|
|
||||||
|
lv_style_int_t align = lv_obj_get_style_value_align(slider, LV_SLIDER_PART_KNOB);
|
||||||
|
lv_style_int_t xofs = lv_obj_get_style_value_ofs_x(slider, LV_SLIDER_PART_KNOB);
|
||||||
|
lv_style_int_t yofs = lv_obj_get_style_value_ofs_y(slider, LV_SLIDER_PART_KNOB);
|
||||||
|
lv_point_t p_align;
|
||||||
|
lv_area_align(&slider->coords, &value_area, align, &p_align);
|
||||||
|
|
||||||
|
value_area.x1 += p_align.x + xofs;
|
||||||
|
value_area.y1 += p_align.y + yofs;
|
||||||
|
value_area.x2 += p_align.x + xofs;
|
||||||
|
value_area.y2 += p_align.y + yofs;
|
||||||
|
|
||||||
|
slider->ext_draw_pad = LV_MATH_MAX(slider->ext_draw_pad, slider->coords.x1 - value_area.x1);
|
||||||
|
slider->ext_draw_pad = LV_MATH_MAX(slider->ext_draw_pad, slider->coords.y1 - value_area.y1);
|
||||||
|
slider->ext_draw_pad = LV_MATH_MAX(slider->ext_draw_pad, value_area.x2 - slider->coords.x2);
|
||||||
|
slider->ext_draw_pad = LV_MATH_MAX(slider->ext_draw_pad, value_area.y2 - slider->coords.y2);
|
||||||
|
}
|
||||||
|
|
||||||
} else if(sign == LV_SIGNAL_CONTROL) {
|
} else if(sign == LV_SIGNAL_CONTROL) {
|
||||||
char c = *((char *)param);
|
char c = *((char *)param);
|
||||||
|
|
||||||
|
|||||||
@@ -1678,8 +1678,8 @@ static void refr_cursor_area(lv_obj_t * ta)
|
|||||||
{
|
{
|
||||||
lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta);
|
lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta);
|
||||||
|
|
||||||
const lv_font_t * font = lv_obj_get_style_ptr(ta, LV_TA_PART_BG, LV_STYLE_FONT);
|
const lv_font_t * font = lv_obj_get_style_ptr(ta, LV_TA_PART_BG, LV_STYLE_TEXT_FONT);
|
||||||
lv_style_int_t line_space = lv_obj_get_style_int(ta, LV_TA_PART_BG, LV_STYLE_LINE_SPACE);
|
lv_style_int_t line_space = lv_obj_get_style_int(ta, LV_TA_PART_BG, LV_STYLE_TEXT_LINE_SPACE);
|
||||||
|
|
||||||
uint16_t cur_pos = lv_ta_get_cursor_pos(ta);
|
uint16_t cur_pos = lv_ta_get_cursor_pos(ta);
|
||||||
const char * txt = lv_label_get_text(ext->label);
|
const char * txt = lv_label_get_text(ext->label);
|
||||||
|
|||||||
@@ -275,13 +275,14 @@ static void basic_init(void)
|
|||||||
lv_style_set_border_color(&btn, LV_STYLE_STATE_FOCUS, LV_COLOR_RED);
|
lv_style_set_border_color(&btn, LV_STYLE_STATE_FOCUS, LV_COLOR_RED);
|
||||||
lv_style_set_border_width(&btn, LV_STYLE_STATE_NORMAL, 2);
|
lv_style_set_border_width(&btn, LV_STYLE_STATE_NORMAL, 2);
|
||||||
lv_style_set_border_opa(&btn, LV_STYLE_STATE_NORMAL, LV_OPA_50);
|
lv_style_set_border_opa(&btn, LV_STYLE_STATE_NORMAL, LV_OPA_50);
|
||||||
lv_style_set_shadow_width(&btn, LV_STYLE_STATE_NORMAL, 10);
|
lv_style_set_shadow_blend_mode(&btn, LV_STYLE_STATE_NORMAL, LV_BLEND_MODE_NORMAL);
|
||||||
|
lv_style_set_shadow_width(&btn, LV_STYLE_STATE_NORMAL, 20);
|
||||||
lv_style_set_shadow_width(&btn, LV_STYLE_STATE_PRESSED, 2);
|
lv_style_set_shadow_width(&btn, LV_STYLE_STATE_PRESSED, 2);
|
||||||
lv_style_set_shadow_offset_x(&btn, LV_STYLE_STATE_NORMAL, -4);
|
lv_style_set_shadow_offset_x(&btn, LV_STYLE_STATE_NORMAL, -4);
|
||||||
lv_style_set_shadow_offset_y(&btn, LV_STYLE_STATE_NORMAL, 8);
|
lv_style_set_shadow_offset_y(&btn, LV_STYLE_STATE_NORMAL, 8);
|
||||||
// lv_style_set_shadow_offset_y(&btn, LV_STYLE_STATE_PRESSED, 1);
|
// lv_style_set_shadow_offset_y(&btn, LV_STYLE_STATE_PRESSED, 1);
|
||||||
lv_style_set_shadow_color(&btn, LV_STYLE_STATE_NORMAL, LV_COLOR_BLUE);
|
lv_style_set_shadow_color(&btn, LV_STYLE_STATE_NORMAL, LV_COLOR_BLUE);
|
||||||
// lv_style_set_shadow_spread(&btn, LV_STYLE_STATE_NORMAL, 5);
|
lv_style_set_shadow_spread(&btn, LV_STYLE_STATE_NORMAL, 5);
|
||||||
lv_style_set_text_color(&btn, LV_STYLE_STATE_NORMAL, LV_COLOR_WHITE);
|
lv_style_set_text_color(&btn, LV_STYLE_STATE_NORMAL, LV_COLOR_WHITE);
|
||||||
lv_style_set_text_color(&btn, LV_STYLE_STATE_PRESSED, LV_COLOR_BLACK);
|
lv_style_set_text_color(&btn, LV_STYLE_STATE_PRESSED, LV_COLOR_BLACK);
|
||||||
lv_style_set_text_color(&btn, LV_STYLE_STATE_DISABLED, LV_COLOR_SILVER);
|
lv_style_set_text_color(&btn, LV_STYLE_STATE_DISABLED, LV_COLOR_SILVER);
|
||||||
@@ -693,7 +694,7 @@ static void tabview_init(void)
|
|||||||
lv_style_set_int(&tabview_btns_bg, LV_STYLE_BORDER_WIDTH, LV_DPI / 30 > 0 ? LV_DPI / 30 : 1);
|
lv_style_set_int(&tabview_btns_bg, LV_STYLE_BORDER_WIDTH, LV_DPI / 30 > 0 ? LV_DPI / 30 : 1);
|
||||||
lv_style_set_int(&tabview_btns_bg, LV_STYLE_BORDER_SIDE , LV_BORDER_SIDE_BOTTOM);
|
lv_style_set_int(&tabview_btns_bg, LV_STYLE_BORDER_SIDE , LV_BORDER_SIDE_BOTTOM);
|
||||||
lv_style_set_color(&tabview_btns_bg, LV_STYLE_TEXT_COLOR, lv_color_hex(0x979a9f));
|
lv_style_set_color(&tabview_btns_bg, LV_STYLE_TEXT_COLOR, lv_color_hex(0x979a9f));
|
||||||
lv_style_set_ptr(&tabview_btns_bg, LV_STYLE_FONT, &lv_font_roboto_16);
|
lv_style_set_ptr(&tabview_btns_bg, LV_STYLE_TEXT_FONT, &lv_font_roboto_16);
|
||||||
lv_style_set_color(&tabview_btns_bg, LV_STYLE_IMAGE_RECOLOR, lv_color_hex(0x979a9f));
|
lv_style_set_color(&tabview_btns_bg, LV_STYLE_IMAGE_RECOLOR, lv_color_hex(0x979a9f));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -76,13 +76,13 @@ static void empty_style(void)
|
|||||||
|
|
||||||
lv_test_print("Get a properties from an empty style");
|
lv_test_print("Get a properties from an empty style");
|
||||||
|
|
||||||
found = lv_style_list_get_int(&style_list, LV_STYLE_LINE_SPACE, &value);
|
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||||
lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'int' property");
|
lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'int' property");
|
||||||
|
|
||||||
found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa);
|
found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa);
|
||||||
lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'opa' property");
|
lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'opa' property");
|
||||||
|
|
||||||
found = lv_style_list_get_ptr(&style_list, LV_STYLE_FONT, &ptr);
|
found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr);
|
||||||
lv_test_assert_int_eq(LV_RES_INV, found, "Get a 'ptr' property");
|
lv_test_assert_int_eq(LV_RES_INV, found, "Get a 'ptr' property");
|
||||||
|
|
||||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color);
|
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color);
|
||||||
@@ -111,25 +111,25 @@ static void add_remove_read_prop(void)
|
|||||||
|
|
||||||
lv_test_print("Add an empty style and read properties");
|
lv_test_print("Add an empty style and read properties");
|
||||||
|
|
||||||
found = lv_style_list_get_int(&style_list, LV_STYLE_LINE_SPACE, &value);
|
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||||
lv_test_assert_int_eq(LV_RES_INV, found, "Get a non existing 'int' property");
|
lv_test_assert_int_eq(LV_RES_INV, found, "Get a non existing 'int' property");
|
||||||
|
|
||||||
found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa);
|
found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa);
|
||||||
lv_test_assert_int_eq(LV_RES_INV, found, "Get a non existing 'opa' property");
|
lv_test_assert_int_eq(LV_RES_INV, found, "Get a non existing 'opa' property");
|
||||||
|
|
||||||
found = lv_style_list_get_ptr(&style_list, LV_STYLE_FONT, &ptr);
|
found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr);
|
||||||
lv_test_assert_int_eq(LV_RES_INV, found, "Get a non existing 'ptr' property");
|
lv_test_assert_int_eq(LV_RES_INV, found, "Get a non existing 'ptr' property");
|
||||||
|
|
||||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color);
|
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color);
|
||||||
lv_test_assert_int_eq(LV_RES_INV, found, "Get a non existing 'color' property");
|
lv_test_assert_int_eq(LV_RES_INV, found, "Get a non existing 'color' property");
|
||||||
|
|
||||||
lv_test_print("Set properties and read back the values");
|
lv_test_print("Set properties and read back the values");
|
||||||
lv_style_set_int(&style, LV_STYLE_LINE_SPACE, 5);
|
lv_style_set_int(&style, LV_STYLE_TEXT_LINE_SPACE, 5);
|
||||||
lv_style_set_opa(&style, LV_STYLE_BG_OPA, LV_OPA_50);
|
lv_style_set_opa(&style, LV_STYLE_BG_OPA, LV_OPA_50);
|
||||||
lv_style_set_ptr(&style, LV_STYLE_FONT, LV_FONT_DEFAULT);
|
lv_style_set_ptr(&style, LV_STYLE_TEXT_FONT, LV_FONT_DEFAULT);
|
||||||
lv_style_set_color(&style, LV_STYLE_BG_COLOR, LV_COLOR_RED);
|
lv_style_set_color(&style, LV_STYLE_BG_COLOR, LV_COLOR_RED);
|
||||||
|
|
||||||
found = lv_style_list_get_int(&style_list, LV_STYLE_LINE_SPACE, &value);
|
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'int' property");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'int' property");
|
||||||
lv_test_assert_int_eq(5, value, "Get the value of an 'int' property");
|
lv_test_assert_int_eq(5, value, "Get the value of an 'int' property");
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ static void add_remove_read_prop(void)
|
|||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'opa' property");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'opa' property");
|
||||||
lv_test_assert_int_eq(LV_OPA_50, opa, "Get the value of an 'opa' property");
|
lv_test_assert_int_eq(LV_OPA_50, opa, "Get the value of an 'opa' property");
|
||||||
|
|
||||||
found = lv_style_list_get_ptr(&style_list, LV_STYLE_FONT, &ptr);
|
found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'ptr' property");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an existing 'ptr' property");
|
||||||
lv_test_assert_ptr_eq(LV_FONT_DEFAULT, ptr, "Get the value of a 'ptr' property");
|
lv_test_assert_ptr_eq(LV_FONT_DEFAULT, ptr, "Get the value of a 'ptr' property");
|
||||||
|
|
||||||
@@ -147,13 +147,13 @@ static void add_remove_read_prop(void)
|
|||||||
|
|
||||||
lv_test_print("Reset the the style");
|
lv_test_print("Reset the the style");
|
||||||
lv_style_reset(&style);
|
lv_style_reset(&style);
|
||||||
found = lv_style_list_get_int(&style_list, LV_STYLE_LINE_SPACE, &value);
|
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||||
lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'int' property from a reseted style");
|
lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'int' property from a reseted style");
|
||||||
|
|
||||||
found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa);
|
found = lv_style_list_get_opa(&style_list, LV_STYLE_BG_OPA, &opa);
|
||||||
lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'opa' property from a reseted style");
|
lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'opa' property from a reseted style");
|
||||||
|
|
||||||
found = lv_style_list_get_ptr(&style_list, LV_STYLE_FONT, &ptr);
|
found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr);
|
||||||
lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'ptr' property from a reseted style");
|
lv_test_assert_int_eq(LV_RES_INV, found, "Get an 'ptr' property from a reseted style");
|
||||||
|
|
||||||
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color);
|
found = lv_style_list_get_color(&style_list, LV_STYLE_BG_COLOR, &color);
|
||||||
@@ -189,12 +189,12 @@ static void cascade(void)
|
|||||||
|
|
||||||
lv_test_print("Read properties set only in the firstly added style");
|
lv_test_print("Read properties set only in the firstly added style");
|
||||||
|
|
||||||
lv_style_set_int(&style_first, LV_STYLE_LINE_SPACE, 5);
|
lv_style_set_int(&style_first, LV_STYLE_TEXT_LINE_SPACE, 5);
|
||||||
lv_style_set_opa(&style_first, LV_STYLE_BG_OPA, LV_OPA_50);
|
lv_style_set_opa(&style_first, LV_STYLE_BG_OPA, LV_OPA_50);
|
||||||
lv_style_set_ptr(&style_first, LV_STYLE_FONT, LV_FONT_DEFAULT);
|
lv_style_set_ptr(&style_first, LV_STYLE_TEXT_FONT, LV_FONT_DEFAULT);
|
||||||
lv_style_set_color(&style_first, LV_STYLE_BG_COLOR, LV_COLOR_RED);
|
lv_style_set_color(&style_first, LV_STYLE_BG_COLOR, LV_COLOR_RED);
|
||||||
|
|
||||||
found = lv_style_list_get_int(&style_list, LV_STYLE_LINE_SPACE, &value);
|
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property");
|
||||||
lv_test_assert_int_eq(5, value, "Get the value of an 'int' property");
|
lv_test_assert_int_eq(5, value, "Get the value of an 'int' property");
|
||||||
|
|
||||||
@@ -202,7 +202,7 @@ static void cascade(void)
|
|||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'opa' property");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'opa' property");
|
||||||
lv_test_assert_int_eq(LV_OPA_50, opa, "Get the value of an 'opa' property");
|
lv_test_assert_int_eq(LV_OPA_50, opa, "Get the value of an 'opa' property");
|
||||||
|
|
||||||
found = lv_style_list_get_ptr(&style_list, LV_STYLE_FONT, &ptr);
|
found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'ptr' property");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'ptr' property");
|
||||||
lv_test_assert_ptr_eq(LV_FONT_DEFAULT, ptr, "Get the value of a 'ptr' property");
|
lv_test_assert_ptr_eq(LV_FONT_DEFAULT, ptr, "Get the value of a 'ptr' property");
|
||||||
|
|
||||||
@@ -212,12 +212,12 @@ static void cascade(void)
|
|||||||
|
|
||||||
lv_test_print("Overwrite the properties from the second style");
|
lv_test_print("Overwrite the properties from the second style");
|
||||||
|
|
||||||
lv_style_set_int(&style_second, LV_STYLE_LINE_SPACE, 10);
|
lv_style_set_int(&style_second, LV_STYLE_TEXT_LINE_SPACE, 10);
|
||||||
lv_style_set_opa(&style_second, LV_STYLE_BG_OPA, LV_OPA_60);
|
lv_style_set_opa(&style_second, LV_STYLE_BG_OPA, LV_OPA_60);
|
||||||
lv_style_set_ptr(&style_second, LV_STYLE_FONT, LV_FONT_DEFAULT + 1);
|
lv_style_set_ptr(&style_second, LV_STYLE_TEXT_FONT, LV_FONT_DEFAULT + 1);
|
||||||
lv_style_set_color(&style_second, LV_STYLE_BG_COLOR, LV_COLOR_BLUE);
|
lv_style_set_color(&style_second, LV_STYLE_BG_COLOR, LV_COLOR_BLUE);
|
||||||
|
|
||||||
found = lv_style_list_get_int(&style_list, LV_STYLE_LINE_SPACE, &value);
|
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'int' property");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'int' property");
|
||||||
lv_test_assert_int_eq(10, value, "Get the value of an overwritten 'int' property");
|
lv_test_assert_int_eq(10, value, "Get the value of an overwritten 'int' property");
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@ static void cascade(void)
|
|||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'opa' property");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'opa' property");
|
||||||
lv_test_assert_int_eq(LV_OPA_60, opa, "Get the value of an overwritten 'opa' property");
|
lv_test_assert_int_eq(LV_OPA_60, opa, "Get the value of an overwritten 'opa' property");
|
||||||
|
|
||||||
found = lv_style_list_get_ptr(&style_list, LV_STYLE_FONT, &ptr);
|
found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'ptr' property");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an overwritten 'ptr' property");
|
||||||
lv_test_assert_ptr_eq(LV_FONT_DEFAULT + 1, ptr, "Get the value of an overwritten 'ptr' property");
|
lv_test_assert_ptr_eq(LV_FONT_DEFAULT + 1, ptr, "Get the value of an overwritten 'ptr' property");
|
||||||
|
|
||||||
@@ -235,12 +235,12 @@ static void cascade(void)
|
|||||||
|
|
||||||
|
|
||||||
lv_test_print("Overwrite the properties with the local style");
|
lv_test_print("Overwrite the properties with the local style");
|
||||||
lv_style_list_set_local_int(&style_list, LV_STYLE_LINE_SPACE, 20);
|
lv_style_list_set_local_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, 20);
|
||||||
lv_style_list_set_local_opa(&style_list, LV_STYLE_BG_OPA, LV_OPA_70);
|
lv_style_list_set_local_opa(&style_list, LV_STYLE_BG_OPA, LV_OPA_70);
|
||||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_FONT, LV_FONT_DEFAULT + 2);
|
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT, LV_FONT_DEFAULT + 2);
|
||||||
lv_style_list_set_local_color(&style_list, LV_STYLE_BG_COLOR, LV_COLOR_LIME);
|
lv_style_list_set_local_color(&style_list, LV_STYLE_BG_COLOR, LV_COLOR_LIME);
|
||||||
|
|
||||||
found = lv_style_list_get_int(&style_list, LV_STYLE_LINE_SPACE, &value);
|
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get a local 'int' property");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get a local 'int' property");
|
||||||
lv_test_assert_int_eq(20, value, "Get the value of a local 'int' property");
|
lv_test_assert_int_eq(20, value, "Get the value of a local 'int' property");
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ static void cascade(void)
|
|||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get a local 'opa' property");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get a local 'opa' property");
|
||||||
lv_test_assert_int_eq(LV_OPA_70, opa, "Get the value of a local 'opa' property");
|
lv_test_assert_int_eq(LV_OPA_70, opa, "Get the value of a local 'opa' property");
|
||||||
|
|
||||||
found = lv_style_list_get_ptr(&style_list, LV_STYLE_FONT, &ptr);
|
found = lv_style_list_get_ptr(&style_list, LV_STYLE_TEXT_FONT, &ptr);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get a local 'ptr' property");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get a local 'ptr' property");
|
||||||
lv_test_assert_ptr_eq(LV_FONT_DEFAULT + 2, ptr, "Get the value of a local'ptr' property");
|
lv_test_assert_ptr_eq(LV_FONT_DEFAULT + 2, ptr, "Get the value of a local'ptr' property");
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ static void copy(void)
|
|||||||
lv_test_print("Copy a style");
|
lv_test_print("Copy a style");
|
||||||
lv_style_t style_src;
|
lv_style_t style_src;
|
||||||
lv_style_init(&style_src);
|
lv_style_init(&style_src);
|
||||||
lv_style_set_int(&style_src, LV_STYLE_LINE_SPACE, 5);
|
lv_style_set_int(&style_src, LV_STYLE_TEXT_LINE_SPACE, 5);
|
||||||
|
|
||||||
lv_style_t style_dest;
|
lv_style_t style_dest;
|
||||||
lv_style_copy(&style_dest, &style_src);
|
lv_style_copy(&style_dest, &style_src);
|
||||||
@@ -279,7 +279,7 @@ static void copy(void)
|
|||||||
int16_t weight;
|
int16_t weight;
|
||||||
lv_style_int_t value;
|
lv_style_int_t value;
|
||||||
|
|
||||||
weight = lv_style_get_int(&style_dest, LV_STYLE_LINE_SPACE, &value);
|
weight = lv_style_get_int(&style_dest, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||||
lv_test_assert_int_eq(0, weight, "Get a copied property from a style");
|
lv_test_assert_int_eq(0, weight, "Get a copied property from a style");
|
||||||
lv_test_assert_int_eq(5, value, "Get the value of a copied from a property");
|
lv_test_assert_int_eq(5, value, "Get the value of a copied from a property");
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ static void copy(void)
|
|||||||
lv_style_list_copy(&list_dest, &list_src);
|
lv_style_list_copy(&list_dest, &list_src);
|
||||||
|
|
||||||
lv_res_t found;
|
lv_res_t found;
|
||||||
found = lv_style_list_get_int(&list_dest, LV_STYLE_LINE_SPACE, &value);
|
found = lv_style_list_get_int(&list_dest, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get a copied property from a list");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get a copied property from a list");
|
||||||
lv_test_assert_int_eq(5, value, "Get the value of a copied property from a list");
|
lv_test_assert_int_eq(5, value, "Get the value of a copied property from a list");
|
||||||
found = lv_style_list_get_int(&list_dest, LV_STYLE_LINE_DASH_WIDTH, &value);
|
found = lv_style_list_get_int(&list_dest, LV_STYLE_LINE_DASH_WIDTH, &value);
|
||||||
@@ -327,30 +327,30 @@ static void states(void)
|
|||||||
lv_style_list_add_style(&style_list, &style_second);
|
lv_style_list_add_style(&style_list, &style_second);
|
||||||
|
|
||||||
lv_test_print("Test state precedence in 1 style");
|
lv_test_print("Test state precedence in 1 style");
|
||||||
lv_style_set_int(&style_first, LV_STYLE_LINE_SPACE, 5);
|
lv_style_set_int(&style_first, LV_STYLE_TEXT_LINE_SPACE, 5);
|
||||||
lv_style_set_int(&style_first, LV_STYLE_LINE_SPACE | LV_STYLE_STATE_CHECKED, 6);
|
lv_style_set_int(&style_first, LV_STYLE_TEXT_LINE_SPACE | LV_STYLE_STATE_CHECKED, 6);
|
||||||
lv_style_set_int(&style_first, LV_STYLE_LINE_SPACE | LV_STYLE_STATE_PRESSED, 7);
|
lv_style_set_int(&style_first, LV_STYLE_TEXT_LINE_SPACE | LV_STYLE_STATE_PRESSED, 7);
|
||||||
|
|
||||||
lv_res_t found;
|
lv_res_t found;
|
||||||
lv_style_int_t value;
|
lv_style_int_t value;
|
||||||
|
|
||||||
found = lv_style_list_get_int(&style_list, LV_STYLE_LINE_SPACE, &value);
|
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE, &value);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in normal state");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in normal state");
|
||||||
lv_test_assert_int_eq(5, value, "Get the value of an 'int' property in normal state");
|
lv_test_assert_int_eq(5, value, "Get the value of an 'int' property in normal state");
|
||||||
|
|
||||||
found = lv_style_list_get_int(&style_list, LV_STYLE_LINE_SPACE | LV_STYLE_STATE_CHECKED, &value);
|
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | LV_STYLE_STATE_CHECKED, &value);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in checked state");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in checked state");
|
||||||
lv_test_assert_int_eq(6, value, "Get the value of an 'int' in checked state");
|
lv_test_assert_int_eq(6, value, "Get the value of an 'int' in checked state");
|
||||||
|
|
||||||
found = lv_style_list_get_int(&style_list, LV_STYLE_LINE_SPACE | LV_STYLE_STATE_PRESSED, &value);
|
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | LV_STYLE_STATE_PRESSED, &value);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in pressed state");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in pressed state");
|
||||||
lv_test_assert_int_eq(7, value, "Get the value of an 'int' in pressed state");
|
lv_test_assert_int_eq(7, value, "Get the value of an 'int' in pressed state");
|
||||||
|
|
||||||
found = lv_style_list_get_int(&style_list, LV_STYLE_LINE_SPACE | LV_STYLE_STATE_HOVER, &value);
|
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | LV_STYLE_STATE_HOVER, &value);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in hover (unspecified) state");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in hover (unspecified) state");
|
||||||
lv_test_assert_int_eq(5, value, "Get the value of an 'int' in hover (unspecified) state");
|
lv_test_assert_int_eq(5, value, "Get the value of an 'int' in hover (unspecified) state");
|
||||||
|
|
||||||
found = lv_style_list_get_int(&style_list, LV_STYLE_LINE_SPACE | LV_STYLE_STATE_CHECKED | LV_STYLE_STATE_PRESSED | LV_STYLE_STATE_HOVER, &value);
|
found = lv_style_list_get_int(&style_list, LV_STYLE_TEXT_LINE_SPACE | LV_STYLE_STATE_CHECKED | LV_STYLE_STATE_PRESSED | LV_STYLE_STATE_HOVER, &value);
|
||||||
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in checked pressed hovered state");
|
lv_test_assert_int_eq(LV_RES_OK, found, "Get an 'int' property in checked pressed hovered state");
|
||||||
lv_test_assert_int_eq(7, value, "Get the value of an 'int' in checked pressed hovered state");
|
lv_test_assert_int_eq(7, value, "Get the value of an 'int' in checked pressed hovered state");
|
||||||
|
|
||||||
@@ -466,11 +466,11 @@ static void mem_leak(void)
|
|||||||
lv_test_print("Use local style");
|
lv_test_print("Use local style");
|
||||||
lv_mem_monitor(&mon_start);
|
lv_mem_monitor(&mon_start);
|
||||||
for(i = 0; i < 100; i++) {
|
for(i = 0; i < 100; i++) {
|
||||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_FONT | LV_STYLE_STATE_PRESSED, LV_FONT_DEFAULT);
|
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | LV_STYLE_STATE_PRESSED, LV_FONT_DEFAULT);
|
||||||
|
|
||||||
lv_style_list_reset(&style_list);
|
lv_style_list_reset(&style_list);
|
||||||
|
|
||||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_FONT | LV_STYLE_STATE_PRESSED, NULL);
|
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | LV_STYLE_STATE_PRESSED, NULL);
|
||||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
||||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
||||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
||||||
@@ -600,8 +600,8 @@ static void mem_leak(void)
|
|||||||
lv_style_set_int(&style3, LV_STYLE_PAD_LEFT, 12);
|
lv_style_set_int(&style3, LV_STYLE_PAD_LEFT, 12);
|
||||||
lv_style_set_int(&style3, LV_STYLE_PAD_RIGHT, 23);
|
lv_style_set_int(&style3, LV_STYLE_PAD_RIGHT, 23);
|
||||||
|
|
||||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_FONT | LV_STYLE_STATE_PRESSED, LV_FONT_DEFAULT);
|
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | LV_STYLE_STATE_PRESSED, LV_FONT_DEFAULT);
|
||||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_FONT | LV_STYLE_STATE_PRESSED, NULL);
|
lv_style_list_set_local_ptr(&style_list, LV_STYLE_TEXT_FONT | LV_STYLE_STATE_PRESSED, NULL);
|
||||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
||||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
||||||
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
lv_style_list_set_local_ptr(&style_list, LV_STYLE_PATTERN_IMAGE, LV_SYMBOL_OK);
|
||||||
|
|||||||
Reference in New Issue
Block a user