efl_ui: always set restricted_min size hints internally

Summary:
regular min size hint is for users, internal calcs should use restricted

@fix

Depends on D9441

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9442
This commit is contained in:
Mike Blumenkrantz 2019-07-30 13:12:07 -04:00
parent 872d43f0a0
commit d17ec12faf
7 changed files with 13 additions and 14 deletions

View File

@ -182,7 +182,7 @@ flush_min_size(Eo *obj, Efl_Ui_Collection_Data *pd)
if (!pd->match_content.h) if (!pd->match_content.h)
tmp.h = -1; tmp.h = -1;
efl_gfx_hint_size_min_set(obj, tmp); efl_gfx_hint_size_restricted_min_set(obj, tmp);
} }
static int static int

View File

@ -117,9 +117,8 @@ _efl_ui_internal_text_scroller_efl_canvas_group_group_calculate(Eo *obj,
fsz.w = view.w; fsz.w = view.w;
} }
// FIXME: should be restricted_min?
efl_gfx_entity_size_set(sd->text_table, fsz); efl_gfx_entity_size_set(sd->text_table, fsz);
efl_gfx_hint_size_min_set(obj, size); efl_gfx_hint_size_restricted_min_set(obj, size);
efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(-1, size.h)); efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(-1, size.h));
} }
} }

View File

@ -100,7 +100,7 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Scroll_Alert_Popup_Data *pd,
} }
efl_canvas_group_calculate(pd->scroller); efl_canvas_group_calculate(pd->scroller);
efl_gfx_hint_size_min_set(obj, new_min); efl_gfx_hint_size_restricted_min_set(obj, new_min);
} }
static void static void

View File

@ -340,7 +340,7 @@ _efl_ui_scroller_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Scroller_Data
if ((max.w > 0) && (size.w > max.w)) size.w = max.w; if ((max.w > 0) && (size.w > max.w)) size.w = max.w;
if ((max.h > 0) && (size.h > max.h)) size.h = max.h; if ((max.h > 0) && (size.h > max.h)) size.h = max.h;
efl_gfx_hint_size_min_set(obj, size); efl_gfx_hint_size_restricted_min_set(obj, size);
} }
EOLIAN static Eina_Error EOLIAN static Eina_Error

View File

@ -119,7 +119,7 @@ _shrink_mode_set(Eo *obj,
edje_object_size_min_calc(sd->end, &w_label_count, &h); edje_object_size_min_calc(sd->end, &w_label_count, &h);
elm_coords_finger_size_adjust(1, &w_label_count, 1, &h); elm_coords_finger_size_adjust(1, &w_label_count, 1, &h);
efl_gfx_hint_size_min_set(sd->end, EINA_SIZE2D(w_label_count, h)); efl_gfx_hint_size_restricted_min_set(sd->end, EINA_SIZE2D(w_label_count, h));
elm_box_pack_end(sd->box, sd->end); elm_box_pack_end(sd->box, sd->end);
evas_object_show(sd->end); evas_object_show(sd->end);
@ -425,7 +425,7 @@ _item_new(Efl_Ui_Tags_Data *sd,
if (sd->w_box && min.w > r.w) if (sd->w_box && min.w > r.w)
{ {
elm_coords_finger_size_adjust(1, &r.w, 1, &min.h); elm_coords_finger_size_adjust(1, &r.w, 1, &min.h);
efl_gfx_hint_size_min_set(layout, EINA_SIZE2D(r.w, min.h)); efl_gfx_hint_size_restricted_min_set(layout, EINA_SIZE2D(r.w, min.h));
efl_gfx_entity_size_set(layout, EINA_SIZE2D(r.w, min.h)); efl_gfx_entity_size_set(layout, EINA_SIZE2D(r.w, min.h));
} }
@ -514,7 +514,7 @@ _box_resize_cb(void *data,
if (min.w > r.w - hpad) if (min.w > r.w - hpad)
{ {
min.w = r.w - hpad; min.w = r.w - hpad;
efl_gfx_hint_size_min_set(layout, EINA_SIZE2D(min.w, min.h)); efl_gfx_hint_size_restricted_min_set(layout, EINA_SIZE2D(min.w, min.h));
efl_gfx_entity_size_set(layout, EINA_SIZE2D(min.w, min.h)); efl_gfx_entity_size_set(layout, EINA_SIZE2D(min.w, min.h));
} }
} }
@ -764,7 +764,7 @@ _box_min_size_calculate(Evas_Object *box,
} }
box_min.h = lineh * line_num + (line_num - 1) * priv->pad.v; box_min.h = lineh * line_num + (line_num - 1) * priv->pad.v;
efl_gfx_hint_size_min_set(box, EINA_SIZE2D(box_min.w, box_min.h)); efl_gfx_hint_size_restricted_min_set(box, EINA_SIZE2D(box_min.w, box_min.h));
*line_height = lineh; *line_height = lineh;
return EINA_TRUE; return EINA_TRUE;
@ -911,7 +911,7 @@ _view_init(Evas_Object *obj, Efl_Ui_Tags_Data *sd)
efl_text_interactive_editable_set(efl_added, EINA_TRUE), efl_text_interactive_editable_set(efl_added, EINA_TRUE),
efl_composite_attach(obj, efl_added)); efl_composite_attach(obj, efl_added));
efl_gfx_hint_size_min_set(sd->entry, EINA_SIZE2D(MIN_W_ENTRY, 0)); efl_gfx_hint_size_restricted_min_set(sd->entry, EINA_SIZE2D(MIN_W_ENTRY, 0));
evas_object_size_hint_weight_set evas_object_size_hint_weight_set
(sd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); (sd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_hint_fill_set(sd->entry, EINA_TRUE, EINA_TRUE); efl_gfx_hint_fill_set(sd->entry, EINA_TRUE, EINA_TRUE);
@ -929,7 +929,7 @@ _view_init(Evas_Object *obj, Efl_Ui_Tags_Data *sd)
edje_object_size_min_calc(sd->end, &button_min_width, &button_min_height); edje_object_size_min_calc(sd->end, &button_min_width, &button_min_height);
elm_coords_finger_size_adjust(1, &button_min_width, 1, &button_min_height); elm_coords_finger_size_adjust(1, &button_min_width, 1, &button_min_height);
efl_gfx_hint_size_min_set(sd->end, EINA_SIZE2D(button_min_width, button_min_height)); efl_gfx_hint_size_restricted_min_set(sd->end, EINA_SIZE2D(button_min_width, button_min_height));
elm_widget_sub_object_add(obj, sd->end); elm_widget_sub_object_add(obj, sd->end);
} }
} }

View File

@ -104,7 +104,7 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd, Eina_Size2D obj
} }
efl_canvas_group_calculate(pd->scroller); efl_canvas_group_calculate(pd->scroller);
efl_gfx_hint_size_min_set(obj, new_min); efl_gfx_hint_size_restricted_min_set(obj, new_min);
} }
EOLIAN static void EOLIAN static void

View File

@ -883,7 +883,7 @@ _efl_ui_textpath_circular_set(Eo *obj, Efl_Ui_Textpath_Data *pd, double radius,
_path_start_angle_adjust(obj, pd); _path_start_angle_adjust(obj, pd);
_sizing_eval(pd); _sizing_eval(pd);
efl_gfx_hint_size_min_set(obj, EINA_SIZE2D((radius * 2) + text_size.h, (radius * 2) + text_size.h)); efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D((radius * 2) + text_size.h, (radius * 2) + text_size.h));
} }
EOLIAN static int EOLIAN static int
@ -1003,7 +1003,7 @@ elm_textpath_circle_set(Eo *obj, double x, double y, double radius, double start
_path_start_angle_adjust(obj, pd); _path_start_angle_adjust(obj, pd);
_sizing_eval(pd); _sizing_eval(pd);
efl_gfx_hint_size_min_set(obj, EINA_SIZE2D(x * 2, y * 2)); efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(x * 2, y * 2));
} }
#include "efl_ui_textpath_legacy_eo.c" #include "efl_ui_textpath_legacy_eo.c"