From: Mike Blumenkrantz Date: Tue, 30 Jul 2019 17:11:24 +0000 (-0400) Subject: efl_ui/layout: use min size hints when calculating layout size X-Git-Tag: submit/tizen/20190805.083058~83 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=626bab4c74e6270a824759ea2c9ad44a14217ac1;p=platform%2Fupstream%2Fefl.git efl_ui/layout: use min size hints when calculating layout size Summary: for legacy layouts, all min size hints should be considered when performing size calculations for non-legacy layouts, only "user" min size hints should be considered, as we are calculating the restricted min size hint in this function Depends on D9434 Reviewers: bu5hm4n Reviewed By: bu5hm4n Subscribers: bu5hm4n, cedric, #reviewers, #committers Tags: #efl_widgets Maniphest Tasks: T8059 Differential Revision: https://phab.enlightenment.org/D9435 --- diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 94bb517..883234b 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -174,12 +174,25 @@ _part_cursor_free(Efl_Ui_Layout_Sub_Object_Cursor *pc) static void _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd) { - Evas_Coord minh = -1, minw = -1; - Evas_Coord rest_w = 0, rest_h = 0; + int minh = 0, minw = 0; + int rest_w = 0, rest_h = 0; + Eina_Size2D sz; ELM_WIDGET_DATA_GET_OR_RETURN(sd->obj, wd); if (!efl_alive_get(obj)) return; + if (elm_widget_is_legacy(obj)) + sz = efl_gfx_hint_size_combined_min_get(obj); + else + sz = efl_gfx_hint_size_min_get(obj); + minw = sz.w; + minh = sz.h; + + if (minw > rest_w) + rest_w = minw; + if (minh > rest_h) + rest_h = minh; + if (sd->restricted_calc_w) rest_w = wd->w; if (sd->restricted_calc_h)