Run code formatter
This commit is contained in:
@@ -1783,7 +1783,8 @@ void lv_event_send_refresh_recursive(lv_obj_t * obj)
|
||||
|
||||
d = lv_disp_get_next(d);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
|
||||
lv_res_t res = lv_event_send_refresh(obj);
|
||||
if(res != LV_RES_OK) return; /*If invalid returned do not check the children*/
|
||||
|
||||
@@ -32,7 +32,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv
|
||||
lv_draw_rect_dsc_t * dsc);
|
||||
|
||||
#if LV_USE_OUTLINE
|
||||
static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
|
||||
static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
|
||||
#endif
|
||||
#if LV_USE_SHADOW
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv_area_t * clip,
|
||||
@@ -43,13 +43,14 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t
|
||||
#endif
|
||||
|
||||
#if LV_USE_PATTERN
|
||||
static void draw_pattern(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);
|
||||
#endif
|
||||
|
||||
#if LV_USE_VALUE_STR
|
||||
static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
|
||||
static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
|
||||
#endif
|
||||
static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * area_outer, const lv_area_t * clip, lv_coord_t radius, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode);
|
||||
static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * area_outer, const lv_area_t * clip,
|
||||
lv_coord_t radius, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode);
|
||||
LV_ATTRIBUTE_FAST_MEM static inline lv_color_t grad_get(lv_draw_rect_dsc_t * dsc, lv_coord_t s, lv_coord_t i);
|
||||
|
||||
/**********************
|
||||
@@ -485,8 +486,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv
|
||||
|
||||
for(h = draw_area.y1; h <= draw_area.y2; h++) {
|
||||
if(normal ||
|
||||
(top_only && fill_area.y1 <= coords->y1 + corner_size) ||
|
||||
(bottom_only && fill_area.y1 >= coords->y2 - corner_size)) {
|
||||
(top_only && fill_area.y1 <= coords->y1 + corner_size) ||
|
||||
(bottom_only && fill_area.y1 >= coords->y2 - corner_size)) {
|
||||
_lv_memset_ff(mask_buf, draw_area_w);
|
||||
mask_res = lv_draw_mask_apply(mask_buf, vdb->area.x1 + draw_area.x1, vdb->area.y1 + h, draw_area_w);
|
||||
_lv_blend_fill(clip, &fill_area, color, mask_buf + buf_ofs, mask_res, opa, blend_mode);
|
||||
@@ -1172,7 +1173,8 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr
|
||||
area_outer.y1 -= dsc->outline_width;
|
||||
area_outer.y2 += dsc->outline_width;
|
||||
|
||||
draw_full_border(&area_inner, &area_outer, clip, dsc->radius, dsc->outline_color, dsc->outline_opa, dsc->outline_blend_mode);
|
||||
draw_full_border(&area_inner, &area_outer, clip, dsc->radius, dsc->outline_color, dsc->outline_opa,
|
||||
dsc->outline_blend_mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1317,7 +1319,8 @@ static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, lv_
|
||||
}
|
||||
#endif
|
||||
|
||||
static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * area_outer, const lv_area_t * clip, lv_coord_t radius, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode)
|
||||
static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * area_outer, const lv_area_t * clip,
|
||||
lv_coord_t radius, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode)
|
||||
{
|
||||
uint8_t other_mask_cnt = lv_draw_mask_get_cnt();
|
||||
bool simple_mode = true;
|
||||
|
||||
@@ -211,7 +211,8 @@ static void basic_init(void)
|
||||
lv_style_set_bg_opa(&styles->bg, LV_STATE_DEFAULT, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&styles->bg, LV_STATE_DEFAULT, COLOR_BG);
|
||||
lv_style_set_border_color(&styles->bg, LV_STATE_DEFAULT, COLOR_BG_BORDER);
|
||||
if((theme.flags & LV_THEME_MATERIAL_FLAG_NO_FOCUS) == 0)lv_style_set_border_color(&styles->bg, LV_STATE_FOCUSED, theme.color_primary);
|
||||
if((theme.flags & LV_THEME_MATERIAL_FLAG_NO_FOCUS) == 0)lv_style_set_border_color(&styles->bg, LV_STATE_FOCUSED,
|
||||
theme.color_primary);
|
||||
lv_style_set_border_color(&styles->bg, LV_STATE_EDITED, theme.color_secondary);
|
||||
lv_style_set_border_width(&styles->bg, LV_STATE_DEFAULT, BORDER_WIDTH);
|
||||
lv_style_set_border_post(&styles->bg, LV_STATE_DEFAULT, true);
|
||||
|
||||
@@ -706,7 +706,8 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl
|
||||
if(btn_state == LV_STATE_DEFAULT) {
|
||||
draw_rect_dsc_act = &draw_rect_rel_dsc;
|
||||
draw_label_dsc_act = &draw_label_rel_dsc;
|
||||
} else if(btn_state == LV_STATE_CHECKED) {
|
||||
}
|
||||
else if(btn_state == LV_STATE_CHECKED) {
|
||||
if(!chk_inited) {
|
||||
btnm->state = LV_STATE_CHECKED;
|
||||
lv_draw_rect_dsc_init(&draw_rect_chk_dsc);
|
||||
@@ -719,7 +720,8 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl
|
||||
}
|
||||
draw_rect_dsc_act = &draw_rect_chk_dsc;
|
||||
draw_label_dsc_act = &draw_label_chk_dsc;
|
||||
} else if(btn_state == LV_STATE_CHECKED) {
|
||||
}
|
||||
else if(btn_state == LV_STATE_CHECKED) {
|
||||
if(!disabled_inited) {
|
||||
btnm->state = LV_STATE_DISABLED;
|
||||
lv_draw_rect_dsc_init(&draw_rect_ina_dsc);
|
||||
|
||||
@@ -492,7 +492,7 @@ static void draw_disc_grad(lv_obj_t * cpicker, const lv_area_t * mask)
|
||||
|
||||
/* Mask outer ring of widget to tidy up ragged edges of lines while drawing outer ring */
|
||||
lv_area_t mask_area_out;
|
||||
lv_area_copy( &mask_area_out, &cpicker->coords);
|
||||
lv_area_copy(&mask_area_out, &cpicker->coords);
|
||||
mask_area_out.x1 += OUTER_MASK_WIDTH;
|
||||
mask_area_out.x2 -= OUTER_MASK_WIDTH;
|
||||
mask_area_out.y1 += OUTER_MASK_WIDTH;
|
||||
|
||||
@@ -440,28 +440,27 @@ void lv_tabview_set_tab_act(lv_obj_t * tabview, uint16_t id, lv_anim_enable_t an
|
||||
* @param id index of the tab the name should be set
|
||||
* @param name new tab name
|
||||
*/
|
||||
void lv_tabview_set_tab_name(lv_obj_t *tabview, uint16_t id, char *name)
|
||||
void lv_tabview_set_tab_name(lv_obj_t * tabview, uint16_t id, char * name)
|
||||
{
|
||||
LV_ASSERT_OBJ(tabview, LV_OBJX_NAME);
|
||||
LV_ASSERT_OBJ(tabview, LV_OBJX_NAME);
|
||||
|
||||
/* get tabview's ext pointer which contains the tab name pointer list */
|
||||
lv_tabview_ext_t *ext = lv_obj_get_ext_attr(tabview);
|
||||
/* get tabview's ext pointer which contains the tab name pointer list */
|
||||
lv_tabview_ext_t * ext = lv_obj_get_ext_attr(tabview);
|
||||
|
||||
/* check for valid tab index */
|
||||
if (ext->tab_cnt > id)
|
||||
{
|
||||
/* reallocate memory for new tab name (use reallocate due to mostly the size didn't change much) */
|
||||
char *str = lv_mem_realloc((void *)ext->tab_name_ptr[id], strlen(name) + 1);
|
||||
LV_ASSERT_MEM(str);
|
||||
/* check for valid tab index */
|
||||
if(ext->tab_cnt > id) {
|
||||
/* reallocate memory for new tab name (use reallocate due to mostly the size didn't change much) */
|
||||
char * str = lv_mem_realloc((void *)ext->tab_name_ptr[id], strlen(name) + 1);
|
||||
LV_ASSERT_MEM(str);
|
||||
|
||||
/* store new tab name at allocated memory */
|
||||
strcpy(str, name);
|
||||
/* update pointer */
|
||||
ext->tab_name_ptr[id] = str;
|
||||
/* store new tab name at allocated memory */
|
||||
strcpy(str, name);
|
||||
/* update pointer */
|
||||
ext->tab_name_ptr[id] = str;
|
||||
|
||||
/* force redrawing of the tab headers */
|
||||
lv_obj_invalidate(ext->btns);
|
||||
}
|
||||
/* force redrawing of the tab headers */
|
||||
lv_obj_invalidate(ext->btns);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -246,7 +246,7 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c)
|
||||
|
||||
lv_res_t res = insert_handler(ta, letter_buf);
|
||||
if(res != LV_RES_OK) return;
|
||||
|
||||
|
||||
if(ext->one_line && (c == '\n' || c == '\r')) {
|
||||
LV_LOG_INFO("Text area: line break ignored in one-line mode");
|
||||
return;
|
||||
@@ -259,7 +259,7 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c)
|
||||
"accepted list)");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*If a new line was added it shouldn't show edge flash effect*/
|
||||
bool edge_flash_en = lv_textarea_get_edge_flash(ta);
|
||||
@@ -337,7 +337,7 @@ void lv_textarea_add_text(lv_obj_t * ta, const char * txt)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
lv_res_t res = insert_handler(ta, txt);
|
||||
if(res != LV_RES_OK) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user