fix(tileview): build error with animations disabled (#3942)

Co-authored-by: spanish-worker <>
This commit is contained in:
spanish-worker
2023-01-24 09:07:23 +01:00
committed by GitHub
parent c539546f74
commit 5c0bb3f85a
9 changed files with 22 additions and 14 deletions

View File

@@ -900,7 +900,8 @@ static void lv_refr_vdb_rotate(lv_area_t * area, lv_color_t * color_p)
* Set the original last_part flag on the last part of rotation. */
if(row + height >= area_h && vdb->last_area && vdb->last_part) {
vdb->flushing_last = 1;
} else {
}
else {
vdb->flushing_last = 0;
}

View File

@@ -352,7 +352,6 @@ static void clear_styles(lv_obj_t * obj, lv_theme_style_t name)
case LV_THEME_TILEVIEW:
lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_BG);
lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR);
lv_obj_clean_style_list(obj, LV_TILEVIEW_PART_EDGE_FLASH);
break;
#endif

View File

@@ -246,8 +246,8 @@ static void basic_init(void)
lv_style_set_bg_color(&styles->bg_click, LV_STATE_DISABLED, COLOR_BG_DIS);
lv_style_set_border_width(&styles->bg_click, LV_STATE_CHECKED, 0);
if((theme.flags & LV_THEME_MATERIAL_FLAG_NO_FOCUS) == 0) {
lv_style_set_border_color(&styles->bg_click, LV_STATE_FOCUSED | LV_STATE_PRESSED,
lv_color_darken(theme.color_primary, LV_OPA_20));
lv_style_set_border_color(&styles->bg_click, LV_STATE_FOCUSED | LV_STATE_PRESSED,
lv_color_darken(theme.color_primary, LV_OPA_20));
}
lv_style_set_border_color(&styles->bg_click, LV_STATE_PRESSED, COLOR_BG_BORDER_PR);

View File

@@ -790,8 +790,10 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR);
_lv_style_list_add_style(list, &styles->sb);
#if LV_USE_ANIMATION
list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_EDGE_FLASH);
_lv_style_list_add_style(list, &styles->bg);
#endif
break;
#endif

View File

@@ -636,8 +636,10 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name)
list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_SCROLLBAR);
_lv_style_list_add_style(list, &styles->bg);
#if LV_USE_ANIMATION
list = lv_obj_get_style_list(obj, LV_TILEVIEW_PART_EDGE_FLASH);
_lv_style_list_add_style(list, &styles->bg);
#endif
break;
#endif

View File

@@ -112,10 +112,11 @@ static inline void lv_gauge_set_range(lv_obj_t * gauge, int32_t min, int32_t max
*/
static inline void lv_gauge_set_critical_value(lv_obj_t * gauge, int32_t value)
{
lv_linemeter_ext_t * ext = (lv_linemeter_ext_t *)lv_obj_get_ext_attr(gauge);
lv_linemeter_ext_t * ext = (lv_linemeter_ext_t *)lv_obj_get_ext_attr(gauge);
if(value > lv_linemeter_get_max_value(gauge)) {
ext->lvl_ofs = 1;
} else {
}
else {
ext->lvl_ofs = -1;
}
lv_linemeter_set_value(gauge, value);

View File

@@ -447,7 +447,8 @@ void lv_linemeter_draw_scale(lv_obj_t * lmeter, const lv_area_t * clip_area, uin
p1.y = y_out_extra;
/* Set the color of the lines */
if(ext->cur_value == ext->min_value || (!ext->mirrored && i > level + ext->lvl_ofs) || (ext->mirrored && i <= level + ext->lvl_ofs)) {
if(ext->cur_value == ext->min_value || (!ext->mirrored && i > level + ext->lvl_ofs) || (ext->mirrored &&
i <= level + ext->lvl_ofs)) {
line_dsc.color = end_color;
line_dsc.width = end_line_width;
}

View File

@@ -360,13 +360,13 @@ void lv_table_set_col_cnt(lv_obj_t * table, uint16_t col_cnt)
if(ext->row_cnt > 0 && ext->col_cnt > 0) {
/*Free the unused cells*/
if(old_col_cnt > col_cnt) {
uint16_t old_cell_cnt = old_col_cnt * ext->row_cnt;
uint32_t new_cell_cnt = ext->col_cnt * ext->row_cnt;
uint32_t i;
for(i = new_cell_cnt; i < old_cell_cnt; i++) {
lv_mem_free(ext->cell_data[i]);
}
}
uint16_t old_cell_cnt = old_col_cnt * ext->row_cnt;
uint32_t new_cell_cnt = ext->col_cnt * ext->row_cnt;
uint32_t i;
for(i = new_cell_cnt; i < old_cell_cnt; i++) {
lv_mem_free(ext->cell_data[i]);
}
}
ext->cell_data = lv_mem_realloc(ext->cell_data, ext->row_cnt * ext->col_cnt * sizeof(char *));
LV_ASSERT_MEM(ext->cell_data);

View File

@@ -47,7 +47,9 @@ typedef struct {
enum {
LV_TILEVIEW_PART_BG = LV_PAGE_PART_BG,
LV_TILEVIEW_PART_SCROLLBAR = LV_PAGE_PART_SCROLLBAR,
#if LV_USE_ANIMATION
LV_TILEVIEW_PART_EDGE_FLASH = LV_PAGE_PART_EDGE_FLASH,
#endif
_LV_TILEVIEW_PART_VIRTUAL_LAST = _LV_PAGE_PART_VIRTUAL_LAST,
_LV_TILEVIEW_PART_REAL_LAST = _LV_PAGE_PART_REAL_LAST
};