feat(style): handle min_width and max_width in lv_table LV_PART_ITEMS (cells)
@@ -188,6 +188,10 @@ void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint16_t row, uint16_t col, con
table->row_h[row] = get_row_height(obj, row, font, letter_space, line_space,
cell_left, cell_right, cell_top, cell_bottom);
+ lv_coord_t minh = lv_obj_get_style_min_height(obj, LV_PART_ITEMS);
+ lv_coord_t maxh = lv_obj_get_style_max_height(obj, LV_PART_ITEMS);
+
+ table->row_h[row] = LV_CLAMP(minh, table->row_h[row], maxh);
}
void lv_table_set_row_cnt(lv_obj_t * obj, uint16_t row_cnt)
@@ -737,9 +741,13 @@ static void refr_size(lv_obj_t * obj, uint32_t strat_row)
lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_ITEMS);
const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_ITEMS);
+ lv_coord_t minh = lv_obj_get_style_min_height(obj, LV_PART_ITEMS);
+ lv_coord_t maxh = lv_obj_get_style_max_height(obj, LV_PART_ITEMS);
+
for(i = strat_row; i < table->row_cnt; i++) {
table->row_h[i] = get_row_height(obj, i, font, letter_space, line_space,
cell_left, cell_right, cell_top, cell_bottom);
+ table->row_h[i] = LV_CLAMP(minh, table->row_h[i], maxh);
}
lv_obj_handle_self_size_chg(obj) ;
