mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
run formatter
This commit is contained in:
parent
a8b49faf6b
commit
bb0c5a968c
@ -24,3 +24,11 @@
|
||||
--preserve-date
|
||||
--formatted
|
||||
--exclude=lv_conf_internal.h
|
||||
--exclude=../src/lv_font/lv_font_roboto_12.c
|
||||
--exclude=../src/lv_font/lv_font_roboto_12_subpx.c
|
||||
--exclude=../src/lv_font/lv_font_roboto_16.c
|
||||
--exclude=../src/lv_font/lv_font_roboto_22.c
|
||||
--exclude=../src/lv_font/lv_font_roboto_28.c
|
||||
--exclude=../src/lv_font/lv_font_roboto_28_compressed.c
|
||||
--exclude=../src/lv_font/lv_font_unscii_8.c
|
||||
|
||||
|
@ -1292,7 +1292,8 @@ void lv_obj_refresh_style(lv_obj_t * obj, lv_style_property_t prop)
|
||||
if(prop == LV_STYLE_PROP_ALL || (prop & LV_STYLE_INHERIT_MASK))
|
||||
/*Send style change signals*/
|
||||
refresh_children_style(obj);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
lv_obj_invalidate(obj);
|
||||
}
|
||||
}
|
||||
|
@ -584,7 +584,8 @@ void _lv_obj_set_style_local_ptr(lv_obj_t * obj, uint8_t type, lv_style_property
|
||||
* For example: `lv_obj_style_get_trasition_path()`
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
static inline void _lv_obj_set_style_local_func_ptr(lv_obj_t * obj, uint8_t type, lv_style_property_t prop, lv_style_prop_cb_t value)
|
||||
static inline void _lv_obj_set_style_local_func_ptr(lv_obj_t * obj, uint8_t type, lv_style_property_t prop,
|
||||
lv_style_prop_cb_t value)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd;
|
||||
fd.fptr = value;
|
||||
@ -603,7 +604,8 @@ static inline void _lv_obj_set_style_local_func_ptr(lv_obj_t * obj, uint8_t type
|
||||
* For example: `lv_obj_style_get_text_font()`
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
static inline void _lv_obj_set_style_local_data_ptr(lv_obj_t * obj, uint8_t type, lv_style_property_t prop, const void * value)
|
||||
static inline void _lv_obj_set_style_local_data_ptr(lv_obj_t * obj, uint8_t type, lv_style_property_t prop,
|
||||
const void * value)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd;
|
||||
fd.fptr = NULL;
|
||||
@ -1089,7 +1091,8 @@ lv_style_fptr_dptr_t _lv_obj_get_style_ptr(const lv_obj_t * obj, uint8_t part, l
|
||||
* For example: `lv_obj_style_get_trasition_path()`
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
static inline lv_style_prop_cb_t _lv_obj_get_style_func_ptr(const lv_obj_t * obj, uint8_t part, lv_style_property_t prop)
|
||||
static inline lv_style_prop_cb_t _lv_obj_get_style_func_ptr(const lv_obj_t * obj, uint8_t part,
|
||||
lv_style_property_t prop)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd;
|
||||
fd = _lv_obj_get_style_ptr(obj, part, prop);
|
||||
|
@ -217,7 +217,8 @@ _LV_OBJ_STYLE_SET_GET_DECLARE(TRANSITION_PROP_6, transition_prop_6, lv_style_int
|
||||
#if LV_USE_ANIMATION
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(TRANSITION_PATH, transition_path, lv_anim_path_cb_t, _func_ptr, func_ptr)
|
||||
#else
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(TRANSITION_PATH, transition_path,lv_style_prop_cb_t, _func_ptr, func_ptr) /*For compatibility*/
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(TRANSITION_PATH, transition_path, lv_style_prop_cb_t, _func_ptr,
|
||||
func_ptr) /*For compatibility*/
|
||||
#endif
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(SCALE_WIDTH, scale_width, lv_style_int_t, _int, scalar)
|
||||
_LV_OBJ_STYLE_SET_GET_DECLARE(SCALE_BORDER_WIDTH, scale_border_width, lv_style_int_t, _int, scalar)
|
||||
|
@ -218,7 +218,7 @@ typedef void(*lv_style_prop_cb_t)(void);
|
||||
typedef union {
|
||||
lv_style_prop_cb_t fptr;
|
||||
const void * dptr;
|
||||
}lv_style_fptr_dptr_t;
|
||||
} lv_style_fptr_dptr_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
@ -512,8 +512,8 @@ static inline int16_t _lv_style_get_data_ptr(const lv_style_t * style, lv_style_
|
||||
fd_res.fptr = NULL;
|
||||
lv_res_t r = _lv_style_get_ptr(style, prop, &fd_res);
|
||||
|
||||
void** res2 = (void**)res;
|
||||
*res2 = (void*)fd_res.dptr;
|
||||
void ** res2 = (void **)res;
|
||||
*res2 = (void *)fd_res.dptr;
|
||||
return r;
|
||||
}
|
||||
|
||||
@ -587,7 +587,8 @@ void lv_style_list_set_local_ptr(lv_style_list_t * list, lv_style_property_t pro
|
||||
* @param value the value to set
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
static inline void lv_style_list_set_local_func_ptr(lv_style_list_t * list, lv_style_property_t prop, lv_style_prop_cb_t value)
|
||||
static inline void lv_style_list_set_local_func_ptr(lv_style_list_t * list, lv_style_property_t prop,
|
||||
lv_style_prop_cb_t value)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd;
|
||||
fd.dptr = NULL;
|
||||
@ -603,7 +604,8 @@ static inline void lv_style_list_set_local_func_ptr(lv_style_list_t * list, lv_s
|
||||
* @param value the value to set
|
||||
* @note for performance reasons it's not checked if the property really has pointer type
|
||||
*/
|
||||
static inline void lv_style_list_set_local_data_ptr(lv_style_list_t * list, lv_style_property_t prop, const void * value)
|
||||
static inline void lv_style_list_set_local_data_ptr(lv_style_list_t * list, lv_style_property_t prop,
|
||||
const void * value)
|
||||
{
|
||||
lv_style_fptr_dptr_t fd;
|
||||
fd.fptr = NULL;
|
||||
|
@ -386,23 +386,24 @@ static void fill_normal(const lv_area_t * disp_area, lv_color_t * disp_buf, con
|
||||
}
|
||||
|
||||
uint32_t * mask32 = (uint32_t *) mask_tmp_x;
|
||||
for(; x <= x_end4; x+= 4) {
|
||||
for(; x <= x_end4; x += 4) {
|
||||
if(*mask32) {
|
||||
if((*mask32) == 0xFFFFFFFF) {
|
||||
disp_buf_tmp[x] = color;
|
||||
disp_buf_tmp[x + 1] = color;
|
||||
disp_buf_tmp[x + 2] = color;
|
||||
disp_buf_tmp[x + 3] = color;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
mask_tmp_x = (const lv_opa_t *)mask32;
|
||||
#if LV_COLOR_SCREEN_TRANSP
|
||||
FILL_NORMAL_MASK_PX_SCR_TRANSP(x, color)
|
||||
FILL_NORMAL_MASK_PX_SCR_TRANSP(x + 1 , color)
|
||||
FILL_NORMAL_MASK_PX_SCR_TRANSP(x + 1, color)
|
||||
FILL_NORMAL_MASK_PX_SCR_TRANSP(x + 2, color)
|
||||
FILL_NORMAL_MASK_PX_SCR_TRANSP(x + 3, color)
|
||||
#else
|
||||
FILL_NORMAL_MASK_PX(x, color)
|
||||
FILL_NORMAL_MASK_PX(x + 1 , color)
|
||||
FILL_NORMAL_MASK_PX(x + 1, color)
|
||||
FILL_NORMAL_MASK_PX(x + 2, color)
|
||||
FILL_NORMAL_MASK_PX(x + 3, color)
|
||||
#endif
|
||||
@ -431,7 +432,8 @@ static void fill_normal(const lv_area_t * disp_area, lv_color_t * disp_buf, con
|
||||
const lv_opa_t * mask_tmp_x = &mask_tmp[draw_area->x1];
|
||||
for(x = draw_area->x1; x <= draw_area->x2; x++) {
|
||||
if(*mask_tmp_x) {
|
||||
if(*mask_tmp_x != last_mask) opa_tmp = *mask_tmp_x == LV_OPA_COVER ? opa : (uint32_t)((uint32_t)(*mask_tmp_x) * opa) >> 8;
|
||||
if(*mask_tmp_x != last_mask) opa_tmp = *mask_tmp_x == LV_OPA_COVER ? opa : (uint32_t)((uint32_t)(
|
||||
*mask_tmp_x) * opa) >> 8;
|
||||
if(*mask_tmp_x != last_mask || last_dest_color.full != disp_buf_tmp[x].full) {
|
||||
#if LV_COLOR_SCREEN_TRANSP
|
||||
if(disp->driver.screen_transp) {
|
||||
@ -682,14 +684,14 @@ static void map_normal(const lv_area_t * disp_area, lv_color_t * disp_buf, cons
|
||||
for(y = draw_area->y1; y <= draw_area->y2; y++) {
|
||||
for(x = draw_area->x1; x <= draw_area->x2; x++) {
|
||||
if(mask_tmp[x]) {
|
||||
#if LV_COLOR_SCREEN_TRANSP
|
||||
#if LV_COLOR_SCREEN_TRANSP
|
||||
if(disp->driver.screen_transp) {
|
||||
lv_color_mix_with_alpha(disp_buf_tmp[x], disp_buf_tmp[x].ch.alpha, map_buf_tmp[x], mask_tmp[x], &res_color,
|
||||
&opa_composed);
|
||||
res_color.ch.alpha = opa_composed;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
if(mask_tmp[x] > LV_OPA_MAX) res_color = map_buf_tmp[x];
|
||||
else res_color = lv_color_mix(map_buf_tmp[x], disp_buf_tmp[x], mask_tmp[x]);
|
||||
@ -709,13 +711,13 @@ static void map_normal(const lv_area_t * disp_area, lv_color_t * disp_buf, cons
|
||||
for(x = draw_area->x1; x <= draw_area->x2; x++) {
|
||||
if(mask_tmp[x]) {
|
||||
lv_opa_t opa_tmp = mask_tmp[x] >= LV_OPA_MAX ? opa : ((opa * mask_tmp[x]) >> 8);
|
||||
#if LV_COLOR_SCREEN_TRANSP
|
||||
#if LV_COLOR_SCREEN_TRANSP
|
||||
if(disp->driver.screen_transp) {
|
||||
lv_color_mix_with_alpha(disp_buf_tmp[x], disp_buf_tmp[x].ch.alpha, map_buf_tmp[x], opa_tmp, &disp_buf_tmp[x],
|
||||
&disp_buf_tmp[x].ch.alpha);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
disp_buf_tmp[x] = lv_color_mix(map_buf_tmp[x], disp_buf_tmp[x], opa_tmp);
|
||||
}
|
||||
|
@ -390,7 +390,7 @@ static void lv_draw_map(const lv_area_t * map_area, const lv_area_t * clip_area,
|
||||
|
||||
/*Prepare the `mask_buf`if there are other masks*/
|
||||
if(other_mask_cnt) {
|
||||
lv_memset_ff(mask_buf,mask_buf_size);
|
||||
lv_memset_ff(mask_buf, mask_buf_size);
|
||||
}
|
||||
|
||||
lv_coord_t draw_area_h = lv_area_get_height(&draw_area);
|
||||
@ -414,13 +414,13 @@ static void lv_draw_map(const lv_area_t * map_area, const lv_area_t * clip_area,
|
||||
continue;
|
||||
}
|
||||
|
||||
#if LV_COLOR_DEPTH == 8
|
||||
#if LV_COLOR_DEPTH == 8
|
||||
c.full = map_px[0];
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
c.full = map_px[0] + (map_px[1] << 8);
|
||||
#elif LV_COLOR_DEPTH == 32
|
||||
#elif LV_COLOR_DEPTH == 32
|
||||
c.full = *((uint32_t *)map_px);
|
||||
#endif
|
||||
#endif
|
||||
map2[px_i].full = c.full;
|
||||
}
|
||||
|
||||
@ -486,15 +486,14 @@ static void lv_draw_map(const lv_area_t * map_area, const lv_area_t * clip_area,
|
||||
|
||||
for(x = 0; x < draw_area_w; x++, map_px += px_size_byte, px_i++) {
|
||||
|
||||
if(transform == false)
|
||||
{
|
||||
if(transform == false) {
|
||||
if(alpha_byte) {
|
||||
lv_opa_t px_opa = map_px[LV_IMG_PX_SIZE_ALPHA_BYTE - 1];
|
||||
mask_buf[px_i] = px_opa;
|
||||
if(px_opa < LV_OPA_MIN) {
|
||||
#if LV_COLOR_DEPTH == 32
|
||||
#if LV_COLOR_DEPTH == 32
|
||||
map2[px_i].ch.alpha = 0xFF;
|
||||
#endif
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -502,13 +501,13 @@ static void lv_draw_map(const lv_area_t * map_area, const lv_area_t * clip_area,
|
||||
mask_buf[px_i] = LV_OPA_COVER;
|
||||
}
|
||||
|
||||
#if LV_COLOR_DEPTH == 8
|
||||
#if LV_COLOR_DEPTH == 8
|
||||
c.full = map_px[0];
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
c.full = map_px[0] + (map_px[1] << 8);
|
||||
#elif LV_COLOR_DEPTH == 32
|
||||
#elif LV_COLOR_DEPTH == 32
|
||||
c.full = *((uint32_t *)map_px);
|
||||
#endif
|
||||
#endif
|
||||
if(chroma_key) {
|
||||
if(c.full == chroma_keyed_color.full) {
|
||||
mask_buf[px_i] = LV_OPA_TRANSP;
|
||||
|
@ -52,7 +52,8 @@ static const uint8_t bpp2_opa_table[4] = {0, 85, 170, 255}; /*Opacity mapping w
|
||||
static const uint8_t bpp4_opa_table[16] = {0, 17, 34, 51, /*Opacity mapping with bpp = 4*/
|
||||
68, 85, 102, 119,
|
||||
136, 153, 170, 187,
|
||||
204, 221, 238, 255};
|
||||
204, 221, 238, 255
|
||||
};
|
||||
static const uint8_t bpp8_opa_table[256] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
@ -68,7 +69,8 @@ static const uint8_t bpp8_opa_table[256] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
|
||||
192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
|
||||
208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
|
||||
224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
|
||||
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255};
|
||||
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
|
||||
};
|
||||
/*clang-format on*/
|
||||
|
||||
/**********************
|
||||
@ -518,7 +520,7 @@ static void draw_letter_normal(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph
|
||||
uint8_t other_mask_cnt = lv_draw_mask_get_cnt();
|
||||
|
||||
uint32_t col_bit_max = 8 - bpp;
|
||||
uint32_t col_bit_row_ofs = (box_w + col_start- col_end) * bpp;
|
||||
uint32_t col_bit_row_ofs = (box_w + col_start - col_end) * bpp;
|
||||
|
||||
for(row = row_start ; row < row_end; row++) {
|
||||
int32_t mask_p_start = mask_p;
|
||||
|
@ -651,7 +651,7 @@ static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
if(k >= len) {
|
||||
return LV_DRAW_MASK_RES_FULL_TRANSP;
|
||||
}
|
||||
if(k >= 0) lv_memset_00(&mask_buf[0],k);
|
||||
if(k >= 0) lv_memset_00(&mask_buf[0], k);
|
||||
|
||||
}
|
||||
else {
|
||||
@ -979,7 +979,7 @@ static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t ab
|
||||
return LV_DRAW_MASK_RES_FULL_TRANSP;
|
||||
}
|
||||
if(kr <= len) {
|
||||
lv_memset_00(&mask_buf[kr],len - kr);
|
||||
lv_memset_00(&mask_buf[kr], len - kr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -381,12 +381,23 @@ static inline uint8_t get_bits(const uint8_t * in, uint32_t bit_pos, uint8_t len
|
||||
{
|
||||
uint8_t bit_mask;
|
||||
switch(len) {
|
||||
case 1: bit_mask = 0x1; break;
|
||||
case 2: bit_mask = 0x3; break;
|
||||
case 3: bit_mask = 0x7; break;
|
||||
case 4: bit_mask = 0xF; break;
|
||||
case 8: bit_mask = 0xFF; break;
|
||||
default: bit_mask = (uint16_t)((uint16_t) 1 << len) - 1;
|
||||
case 1:
|
||||
bit_mask = 0x1;
|
||||
break;
|
||||
case 2:
|
||||
bit_mask = 0x3;
|
||||
break;
|
||||
case 3:
|
||||
bit_mask = 0x7;
|
||||
break;
|
||||
case 4:
|
||||
bit_mask = 0xF;
|
||||
break;
|
||||
case 8:
|
||||
bit_mask = 0xFF;
|
||||
break;
|
||||
default:
|
||||
bit_mask = (uint16_t)((uint16_t) 1 << len) - 1;
|
||||
}
|
||||
|
||||
uint32_t byte_pos = bit_pos >> 3;
|
||||
|
@ -468,7 +468,7 @@ static inline void lv_color_premult(lv_color_t c, uint8_t mix, uint16_t * out)
|
||||
* @return the mixed color
|
||||
* @note 255 won't give clearly `c1`.
|
||||
*/
|
||||
static inline lv_color_t lv_color_mix_premult(uint16_t * premult_c1 , lv_color_t c2, uint8_t mix)
|
||||
static inline lv_color_t lv_color_mix_premult(uint16_t * premult_c1, lv_color_t c2, uint8_t mix)
|
||||
{
|
||||
lv_color_t ret;
|
||||
#if LV_COLOR_DEPTH != 1
|
||||
|
@ -85,7 +85,7 @@ void lv_log_add(lv_log_level_t level, const char * file, int line, const char *
|
||||
}
|
||||
|
||||
static const char * lvl_prefix[] = {"Trace", "Info", "Warn", "Error", "User"};
|
||||
printf("%s: %s \t(%s #%d %s())\n", lvl_prefix[level], buf, &file[p], line ,func);
|
||||
printf("%s: %s \t(%s #%d %s())\n", lvl_prefix[level], buf, &file[p], line, func);
|
||||
#else
|
||||
if(custom_print_cb) custom_print_cb(level, file, line, func, buf);
|
||||
#endif
|
||||
|
@ -57,9 +57,9 @@ typedef struct {
|
||||
#endif /* LV_ENABLE_GC */
|
||||
|
||||
#ifdef LV_ARCH_64
|
||||
#define ALIGN_MASK 0x7
|
||||
#define ALIGN_MASK 0x7
|
||||
#else
|
||||
#define ALIGN_MASK 0x3
|
||||
#define ALIGN_MASK 0x3
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
@ -552,8 +552,8 @@ void * lv_memcpy(void * dst, const void * src, size_t len)
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t * d32 = (uint32_t*)d8;
|
||||
const uint32_t * s32 = (uint32_t*)s8;
|
||||
uint32_t * d32 = (uint32_t *)d8;
|
||||
const uint32_t * s32 = (uint32_t *)s8;
|
||||
while(len > 32) {
|
||||
REPEAT8(COPY32)
|
||||
len -= 32;
|
||||
@ -602,7 +602,7 @@ void lv_memset(void * dst, uint8_t v, size_t len)
|
||||
|
||||
uint32_t v32 = v + (v << 8) + (v << 16) + (v << 24);
|
||||
|
||||
uint32_t * d32 = (uint32_t*)d8;
|
||||
uint32_t * d32 = (uint32_t *)d8;
|
||||
|
||||
while(len > 32) {
|
||||
SET32(v32);
|
||||
@ -638,7 +638,7 @@ void lv_memset(void * dst, uint8_t v, size_t len)
|
||||
*/
|
||||
void lv_memset_00(void * dst, size_t len)
|
||||
{
|
||||
uint8_t * d8 = (uint8_t*) dst;
|
||||
uint8_t * d8 = (uint8_t *) dst;
|
||||
uintptr_t d_align = (lv_uintptr_t) d8 & ALIGN_MASK;
|
||||
|
||||
|
||||
@ -653,7 +653,7 @@ void lv_memset_00(void * dst, size_t len)
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t * d32 = (uint32_t*)d8;
|
||||
uint32_t * d32 = (uint32_t *)d8;
|
||||
while(len > 32) {
|
||||
SET32(0);
|
||||
SET32(0);
|
||||
@ -688,7 +688,7 @@ void lv_memset_00(void * dst, size_t len)
|
||||
*/
|
||||
void lv_memset_ff(void * dst, size_t len)
|
||||
{
|
||||
uint8_t * d8 = (uint8_t*) dst;
|
||||
uint8_t * d8 = (uint8_t *) dst;
|
||||
uintptr_t d_align = (lv_uintptr_t) d8 & ALIGN_MASK;
|
||||
|
||||
|
||||
@ -703,7 +703,7 @@ void lv_memset_ff(void * dst, size_t len)
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t * d32 = (uint32_t*)d8;
|
||||
uint32_t * d32 = (uint32_t *)d8;
|
||||
while(len > 32) {
|
||||
SET32(0xFFFFFFFF);
|
||||
SET32(0xFFFFFFFF);
|
||||
|
@ -760,7 +760,8 @@ static void tabview_init(void)
|
||||
lv_style_init(&tabview_btns_bg);
|
||||
lv_style_set_bg_opa(&tabview_btns_bg, LV_STATE_DEFAULT, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&tabview_btns_bg, LV_STATE_DEFAULT, COLOR_BG);
|
||||
lv_style_set_border_color(&tabview_btns_bg, LV_STATE_DEFAULT, IS_LIGHT ? lv_color_hex(0xe4eaf0) : lv_color_hex(0x3b3e42));
|
||||
lv_style_set_border_color(&tabview_btns_bg, LV_STATE_DEFAULT,
|
||||
IS_LIGHT ? lv_color_hex(0xe4eaf0) : lv_color_hex(0x3b3e42));
|
||||
lv_style_set_border_width(&tabview_btns_bg, LV_STATE_DEFAULT, LV_DPI / 30 > 0 ? LV_DPI / 30 : 1);
|
||||
lv_style_set_border_side(&tabview_btns_bg, LV_STATE_DEFAULT, LV_BORDER_SIDE_BOTTOM);
|
||||
lv_style_set_text_color(&tabview_btns_bg, LV_STATE_DEFAULT, COLOR_SCR_TEXT);
|
||||
|
@ -28,7 +28,7 @@ extern "C" {
|
||||
typedef enum {
|
||||
LV_THEME_MATERIAL_PALETTE_LIGHT,
|
||||
LV_THEME_MATERIAL_PALETTE_DARK,
|
||||
}lv_theme_material_palette_t;
|
||||
} lv_theme_material_palette_t;
|
||||
|
||||
|
||||
/**********************
|
||||
|
@ -382,7 +382,8 @@ static lv_design_res_t lv_arc_design(lv_obj_t * arc, const lv_area_t * clip_area
|
||||
lv_coord_t right_bg = lv_obj_get_style_pad_right(arc, LV_ARC_PART_BG);
|
||||
lv_coord_t top_bg = lv_obj_get_style_pad_top(arc, LV_ARC_PART_BG);
|
||||
lv_coord_t bottom_bg = lv_obj_get_style_pad_bottom(arc, LV_ARC_PART_BG);
|
||||
lv_coord_t r = (LV_MATH_MIN(lv_obj_get_width(arc) - left_bg - right_bg, lv_obj_get_height(arc) - top_bg - bottom_bg)) / 2;
|
||||
lv_coord_t r = (LV_MATH_MIN(lv_obj_get_width(arc) - left_bg - right_bg,
|
||||
lv_obj_get_height(arc) - top_bg - bottom_bg)) / 2;
|
||||
lv_coord_t x = arc->coords.x1 + r + left_bg;
|
||||
lv_coord_t y = arc->coords.y1 + r + top_bg;
|
||||
|
||||
@ -400,7 +401,7 @@ static lv_design_res_t lv_arc_design(lv_obj_t * arc, const lv_area_t * clip_area
|
||||
lv_coord_t right_indic = lv_obj_get_style_pad_right(arc, LV_ARC_PART_INDIC);
|
||||
lv_coord_t top_indic = lv_obj_get_style_pad_top(arc, LV_ARC_PART_INDIC);
|
||||
lv_coord_t bottom_indic = lv_obj_get_style_pad_bottom(arc, LV_ARC_PART_INDIC);
|
||||
r-= LV_MATH_MAX4(left_indic, right_indic, top_indic, bottom_indic);
|
||||
r -= LV_MATH_MAX4(left_indic, right_indic, top_indic, bottom_indic);
|
||||
|
||||
lv_draw_arc(x, y, r, ext->arc_angle_start, ext->arc_angle_end, clip_area, &arc_dsc);
|
||||
}
|
||||
|
@ -485,7 +485,8 @@ static void draw_indic(lv_obj_t * bar, const lv_area_t * clip_area)
|
||||
lv_coord_t anim_cur_value_end_x =
|
||||
(int32_t)((int32_t)anim_length * (ext->cur_value_anim.anim_end - ext->min_value)) / range;
|
||||
|
||||
anim_cur_value_x = anim_cur_value_start_x + (((anim_cur_value_end_x - anim_cur_value_start_x) * ext->cur_value_anim.anim_state) /
|
||||
anim_cur_value_x = anim_cur_value_start_x + (((anim_cur_value_end_x - anim_cur_value_start_x) *
|
||||
ext->cur_value_anim.anim_state) /
|
||||
LV_BAR_ANIM_STATE_END);
|
||||
}
|
||||
else
|
||||
|
@ -233,7 +233,8 @@ void lv_btnmatrix_set_map(lv_obj_t * btnm, const char * map[])
|
||||
/* Set the button's area.
|
||||
* If inner padding is zero then use the prev. button x2 as x1 to avoid rounding
|
||||
* errors*/
|
||||
if(btn_i != 0 && inner == 0 && ((act_x == left && base_dir != LV_BIDI_DIR_RTL) || (act_x + act_unit_w == max_w - right && base_dir == LV_BIDI_DIR_RTL))) {
|
||||
if(btn_i != 0 && inner == 0 && ((act_x == left && base_dir != LV_BIDI_DIR_RTL) ||
|
||||
(act_x + act_unit_w == max_w - right && base_dir == LV_BIDI_DIR_RTL))) {
|
||||
lv_area_set(&ext->button_areas[btn_i], ext->button_areas[btn_i - 1].x2, act_y, act_x + act_unit_w,
|
||||
act_y + btn_h);
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ bool lv_dropdown_get_show_selected(lv_obj_t * ddlist)
|
||||
* @param ddlist pointer to a drop down list
|
||||
* @return open/close animation time [ms]
|
||||
*/
|
||||
uint16_t lv_dropdown_get_anim_time(const lv_obj_t * ddlist)
|
||||
uint16_t lv_dropdown_get_anim_time(const lv_obj_t * ddlist)
|
||||
{
|
||||
LV_ASSERT_OBJ(ddlist, LV_OBJX_NAME);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file lv_gauge.c
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @file lv_gauge.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
|
@ -293,7 +293,8 @@ static lv_design_res_t lv_imgbtn_design(lv_obj_t * imgbtn, const lv_area_t * cli
|
||||
lv_obj_init_draw_img_dsc(imgbtn, LV_IMGBTN_PART_MAIN, &img_dsc);
|
||||
lv_draw_img(&imgbtn->coords, clip_area, src, &img_dsc);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
#if LV_IMGBTN_TILED
|
||||
const void * src = ext->img_src_left[state];
|
||||
if(lv_img_src_get_type(src) == LV_IMG_SRC_SYMBOL) {
|
||||
|
@ -43,7 +43,7 @@ typedef struct {
|
||||
const void * img_src_right[_LV_BTN_STATE_LAST]; /*Store right side images to each state*/
|
||||
#endif
|
||||
lv_img_cf_t act_cf; /*Color format of the currently active image*/
|
||||
uint8_t tiled :1; /*1: the middle src will be repeated to fill the user defined width*/
|
||||
uint8_t tiled : 1; /*1: the middle src will be repeated to fill the user defined width*/
|
||||
} lv_imgbtn_ext_t;
|
||||
|
||||
/*Parts of the image button*/
|
||||
|
@ -298,17 +298,17 @@ void lv_linemeter_draw_scale(lv_obj_t * lmeter, const lv_area_t * clip_area, uin
|
||||
|
||||
lv_area_t mask_area;
|
||||
mask_area.x1 = x_ofs - r_in;
|
||||
mask_area.x2 = x_ofs + r_in-1;
|
||||
mask_area.x2 = x_ofs + r_in - 1;
|
||||
mask_area.y1 = y_ofs - r_in;
|
||||
mask_area.y2 = y_ofs + r_in-1;
|
||||
mask_area.y2 = y_ofs + r_in - 1;
|
||||
lv_draw_mask_radius_param_t mask_in_param;
|
||||
lv_draw_mask_radius_init(&mask_in_param, &mask_area, LV_RADIUS_CIRCLE, true);
|
||||
int16_t mask_in_id = lv_draw_mask_add(&mask_in_param, 0);
|
||||
|
||||
mask_area.x1 = x_ofs - r_out;
|
||||
mask_area.x2 = x_ofs + r_out-1;
|
||||
mask_area.x2 = x_ofs + r_out - 1;
|
||||
mask_area.y1 = y_ofs - r_out;
|
||||
mask_area.y2 = y_ofs + r_out-1;
|
||||
mask_area.y2 = y_ofs + r_out - 1;
|
||||
lv_draw_mask_radius_param_t mask_out_param;
|
||||
lv_draw_mask_radius_init(&mask_out_param, &mask_area, LV_RADIUS_CIRCLE, false);
|
||||
int16_t mask_out_id = lv_draw_mask_add(&mask_out_param, 0);
|
||||
|
@ -986,7 +986,8 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
|
||||
#if LV_USE_GROUP
|
||||
if(lv_obj_get_group(page)) {
|
||||
lv_group_focus_obj(page);
|
||||
} else
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
res = lv_signal_send(page, LV_SIGNAL_FOCUS, NULL);
|
||||
|
@ -273,10 +273,12 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
|
||||
|
||||
lv_coord_t dist_left, dist_right;
|
||||
if(hor) {
|
||||
if((base_dir != LV_BIDI_DIR_RTL && p.x > ext->right_knob_area.x2) || (base_dir == LV_BIDI_DIR_RTL && p.x < ext->right_knob_area.x1)) {
|
||||
if((base_dir != LV_BIDI_DIR_RTL && p.x > ext->right_knob_area.x2) || (base_dir == LV_BIDI_DIR_RTL &&
|
||||
p.x < ext->right_knob_area.x1)) {
|
||||
ext->value_to_set = &ext->bar.cur_value;
|
||||
}
|
||||
else if((base_dir != LV_BIDI_DIR_RTL && p.x < ext->left_knob_area.x1) || (base_dir == LV_BIDI_DIR_RTL && p.x > ext->left_knob_area.x2)) {
|
||||
else if((base_dir != LV_BIDI_DIR_RTL && p.x < ext->left_knob_area.x1) || (base_dir == LV_BIDI_DIR_RTL &&
|
||||
p.x > ext->left_knob_area.x2)) {
|
||||
ext->value_to_set = &ext->bar.start_value;
|
||||
}
|
||||
else {
|
||||
|
@ -219,7 +219,8 @@ static lv_design_res_t lv_switch_design(lv_obj_t * sw, const lv_area_t * clip_ar
|
||||
if(base_dir != LV_BIDI_DIR_RTL) {
|
||||
knob_area.x1 = ext->bar.indic_area.x2 - ((act_indic_w * knob_size) / max_indic_w);
|
||||
knob_area.x2 = knob_area.x1 + knob_size;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
knob_area.x2 = ext->bar.indic_area.x1 + ((act_indic_w * knob_size) / max_indic_w);
|
||||
knob_area.x1 = knob_area.x2 - knob_size;
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ void lv_table_set_cell_crop(lv_obj_t * table, uint16_t row, uint16_t col, bool c
|
||||
LV_ASSERT_OBJ(table, LV_OBJX_NAME);
|
||||
|
||||
lv_table_ext_t * ext = lv_obj_get_ext_attr(table);
|
||||
if( col >= ext->col_cnt) {
|
||||
if(col >= ext->col_cnt) {
|
||||
LV_LOG_WARN("lv_table_set_cell_crop: invalid column");
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user