From e26a0195d6fa0c991efb13496f907d2d0681cb03 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 30 Jul 2019 13:12:07 -0400 Subject: [PATCH] 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 --- src/lib/elementary/efl_ui_collection.c | 2 +- src/lib/elementary/efl_ui_internal_text_scroller.c | 3 +-- src/lib/elementary/efl_ui_scroll_alert_popup.c | 2 +- src/lib/elementary/efl_ui_scroller.c | 2 +- src/lib/elementary/efl_ui_tags.c | 12 ++++++------ src/lib/elementary/efl_ui_text_alert_popup.c | 2 +- src/lib/elementary/efl_ui_textpath.c | 4 ++-- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/lib/elementary/efl_ui_collection.c b/src/lib/elementary/efl_ui_collection.c index b12712b..efc56fc 100644 --- a/src/lib/elementary/efl_ui_collection.c +++ b/src/lib/elementary/efl_ui_collection.c @@ -182,7 +182,7 @@ flush_min_size(Eo *obj, Efl_Ui_Collection_Data *pd) if (!pd->match_content.h) tmp.h = -1; - efl_gfx_hint_size_min_set(obj, tmp); + efl_gfx_hint_size_restricted_min_set(obj, tmp); } static int diff --git a/src/lib/elementary/efl_ui_internal_text_scroller.c b/src/lib/elementary/efl_ui_internal_text_scroller.c index cf6f9fb..f774d2f 100644 --- a/src/lib/elementary/efl_ui_internal_text_scroller.c +++ b/src/lib/elementary/efl_ui_internal_text_scroller.c @@ -117,9 +117,8 @@ _efl_ui_internal_text_scroller_efl_canvas_group_group_calculate(Eo *obj, fsz.w = view.w; } - // FIXME: should be restricted_min? 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)); } } diff --git a/src/lib/elementary/efl_ui_scroll_alert_popup.c b/src/lib/elementary/efl_ui_scroll_alert_popup.c index 476178d..e8d5011 100644 --- a/src/lib/elementary/efl_ui_scroll_alert_popup.c +++ b/src/lib/elementary/efl_ui_scroll_alert_popup.c @@ -100,7 +100,7 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Scroll_Alert_Popup_Data *pd, } 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 diff --git a/src/lib/elementary/efl_ui_scroller.c b/src/lib/elementary/efl_ui_scroller.c index 9ebc526..b726d05 100644 --- a/src/lib/elementary/efl_ui_scroller.c +++ b/src/lib/elementary/efl_ui_scroller.c @@ -345,7 +345,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.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 diff --git a/src/lib/elementary/efl_ui_tags.c b/src/lib/elementary/efl_ui_tags.c index 07f6ac0..a2d3964 100644 --- a/src/lib/elementary/efl_ui_tags.c +++ b/src/lib/elementary/efl_ui_tags.c @@ -119,7 +119,7 @@ _shrink_mode_set(Eo *obj, edje_object_size_min_calc(sd->end, &w_label_count, &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); evas_object_show(sd->end); @@ -425,7 +425,7 @@ _item_new(Efl_Ui_Tags_Data *sd, if (sd->w_box && min.w > r.w) { 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)); } @@ -514,7 +514,7 @@ _box_resize_cb(void *data, if (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)); } } @@ -764,7 +764,7 @@ _box_min_size_calculate(Evas_Object *box, } 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; 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_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 (sd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 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); 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); } } diff --git a/src/lib/elementary/efl_ui_text_alert_popup.c b/src/lib/elementary/efl_ui_text_alert_popup.c index 16fd530..048c2c5 100644 --- a/src/lib/elementary/efl_ui_text_alert_popup.c +++ b/src/lib/elementary/efl_ui_text_alert_popup.c @@ -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_gfx_hint_size_min_set(obj, new_min); + efl_gfx_hint_size_restricted_min_set(obj, new_min); } EOLIAN static void diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c index c06cbf6..bfd51ee 100644 --- a/src/lib/elementary/efl_ui_textpath.c +++ b/src/lib/elementary/efl_ui_textpath.c @@ -883,7 +883,7 @@ _efl_ui_textpath_circular_set(Eo *obj, Efl_Ui_Textpath_Data *pd, double radius, _path_start_angle_adjust(obj, 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 @@ -1003,7 +1003,7 @@ elm_textpath_circle_set(Eo *obj, double x, double y, double radius, double start _path_start_angle_adjust(obj, 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" -- 2.7.4