let sliders and text always stretch to a grid cel, if used in a grid layout
add padding on the right side in grid layouts
This commit is contained in:
committed by
Raphael Coeffic
parent
ee3f51330a
commit
1ab128e084
@@ -46,6 +46,7 @@ class FlexGridLayout
|
|||||||
// padding
|
// padding
|
||||||
lv_obj_set_style_pad_all(obj, padding, LV_PART_MAIN);
|
lv_obj_set_style_pad_all(obj, padding, LV_PART_MAIN);
|
||||||
lv_obj_set_style_pad_left(obj, padding + PAGE_PADDING, LV_PART_MAIN);
|
lv_obj_set_style_pad_left(obj, padding + PAGE_PADDING, LV_PART_MAIN);
|
||||||
|
lv_obj_set_style_pad_right(obj, padding + PAGE_PADDING, LV_PART_MAIN);
|
||||||
lv_obj_set_style_pad_row(obj, padding, LV_PART_MAIN);
|
lv_obj_set_style_pad_row(obj, padding, LV_PART_MAIN);
|
||||||
|
|
||||||
// layout
|
// layout
|
||||||
|
|||||||
@@ -93,6 +93,9 @@ Slider::Slider(Window* parent, const rect_t& rect, int32_t vmin, int32_t vmax,
|
|||||||
lv_style_init(&style_edit);
|
lv_style_init(&style_edit);
|
||||||
lv_style_set_bg_color(&style_edit, makeLvColor(COLOR_THEME_EDIT));
|
lv_style_set_bg_color(&style_edit, makeLvColor(COLOR_THEME_EDIT));
|
||||||
lv_obj_add_style(lvobj, &style_edit, LV_PART_KNOB | LV_STATE_FOCUSED | LV_STATE_EDITED);
|
lv_obj_add_style(lvobj, &style_edit, LV_PART_KNOB | LV_STATE_FOCUSED | LV_STATE_EDITED);
|
||||||
|
|
||||||
|
// always fill a grid cell in x-direction
|
||||||
|
lv_obj_set_style_grid_cell_x_align(lvobj, LV_GRID_ALIGN_STRETCH, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ StaticText::StaticText(Window* parent, const rect_t& rect, std::string txt,
|
|||||||
lv_obj_set_style_bg_opa(lvobj, LV_OPA_100, LV_PART_MAIN);
|
lv_obj_set_style_bg_opa(lvobj, LV_OPA_100, LV_PART_MAIN);
|
||||||
setBackgroundColor(COLOR_THEME_SECONDARY2);
|
setBackgroundColor(COLOR_THEME_SECONDARY2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lv_obj_set_style_grid_cell_x_align(lvobj, LV_GRID_ALIGN_STRETCH, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(DEBUG_WINDOWS)
|
#if defined(DEBUG_WINDOWS)
|
||||||
|
|||||||
Reference in New Issue
Block a user