mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
Merge 9d23260ce5e53015a4e652c1ec7f26d78f37ca95 into dev
This commit is contained in:
commit
ea213d07d1
@ -674,6 +674,9 @@ bool lv_obj_hit_test(lv_obj_t * obj, const lv_point_t * point)
|
||||
*/
|
||||
static bool refr_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h)
|
||||
{
|
||||
lv_obj_t * parent = lv_obj_get_parent(obj);
|
||||
if(parent == NULL) return false;
|
||||
|
||||
/* If the size is managed by the layout don't let to overwrite it.*/
|
||||
if(obj->w_set == LV_SIZE_LAYOUT) w = lv_obj_get_width(obj);
|
||||
if(obj->h_set == LV_SIZE_LAYOUT) h = lv_obj_get_height(obj);
|
||||
@ -691,8 +694,6 @@ static bool refr_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h)
|
||||
lv_area_t ori;
|
||||
lv_obj_get_coords(obj, &ori);
|
||||
|
||||
lv_obj_t * parent = lv_obj_get_parent(obj);
|
||||
|
||||
/*Check if the object inside the parent or not*/
|
||||
lv_area_t parent_fit_area;
|
||||
lv_obj_get_coords_fit(parent, &parent_fit_area);
|
||||
|
@ -178,7 +178,7 @@ void lv_obj_refresh_style(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop)
|
||||
lv_obj_invalidate(obj);
|
||||
|
||||
if(prop == LV_STYLE_PROP_ALL ||
|
||||
((prop & LV_STYLE_PROP_INHERIT) && (prop & LV_STYLE_PROP_EXT_DRAW) && (prop & LV_STYLE_PROP_LAYOUT_REFR)))
|
||||
((prop & LV_STYLE_PROP_INHERIT) && ((prop & LV_STYLE_PROP_EXT_DRAW) || (prop & LV_STYLE_PROP_LAYOUT_REFR))))
|
||||
{
|
||||
if(part != LV_PART_SCROLLBAR) {
|
||||
refresh_children_style(obj);
|
||||
|
@ -555,7 +555,7 @@ static void lv_dropdown_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||
|
||||
if(copy == NULL) {
|
||||
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
|
||||
lv_obj_set_width(obj, LV_DPX(150));
|
||||
lv_obj_set_size(obj, LV_DPX(150), LV_SIZE_CONTENT);
|
||||
lv_dropdown_set_options_static(obj, "Option 1\nOption 2\nOption 3");
|
||||
}
|
||||
/*Copy an existing drop down list*/
|
||||
@ -839,11 +839,10 @@ static lv_res_t lv_dropdown_signal(lv_obj_t * obj, lv_signal_t sign, void * para
|
||||
else if(sign == LV_SIGNAL_COORD_CHG) {
|
||||
if(dropdown->list) lv_dropdown_close(obj);
|
||||
}
|
||||
else if(sign == LV_SIGNAL_STYLE_CHG) {
|
||||
lv_coord_t top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN);
|
||||
lv_coord_t bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN);
|
||||
else if(sign == LV_SIGNAL_GET_SELF_SIZE) {
|
||||
lv_point_t * p = param;
|
||||
const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN);
|
||||
lv_obj_set_height(obj, top + bottom + lv_font_get_line_height(font));
|
||||
p->y = lv_font_get_line_height(font);
|
||||
}
|
||||
else if(sign == LV_SIGNAL_CONTROL) {
|
||||
char c = *((char *)param);
|
||||
|
Loading…
x
Reference in New Issue
Block a user