diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2019-07-30 13:11:48 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2019-07-30 13:12:52 -0400 |
commit | 7e517e2a1196207bbfe76ce9ab12be3093d9afc5 (patch) | |
tree | 106c98b6ad2720f0504b7d254e4efdfcd4cec253 /src/lib/elementary/elm_inwin.c | |
parent | 586f41f92772ab789364bcd788e7717f92ba86de (diff) | |
download | efl-7e517e2a1196207bbfe76ce9ab12be3093d9afc5.tar.gz |
elm/efl_ui: remove elm_layout_sizing_eval implementations
Summary:
historically there have been two methods of calculating sizes in elm:
* elm_layout_sizing_eval
* evas_object_smart_calculate (now efl_canvas_group_calculate)
the former was used to set size hints on widgets, while the latter was
used to perform internal size calcs for the widget. for things to
work correctly, these functions had to be triggered in just the right
order at just the right time. many hard-to-fix bugs related to widget
sizing over the years have been the result of this split
this patch removes elm_layout_sizing_eval implementations so that all
widgets perform both internal size calcs and size hint setting all
in the same function, ensuring that these are always in sync
the result is that in the vast majority of cases, far fewer recalcs
happen for widgets, and they are quicker to achieve their final size
Depends on D9438
Reviewers: bu5hm4n
Reviewed By: bu5hm4n
Subscribers: bu5hm4n, cedric, #reviewers, #committers
Tags: #efl_widgets
Maniphest Tasks: T8059
Differential Revision: https://phab.enlightenment.org/D9439
Diffstat (limited to 'src/lib/elementary/elm_inwin.c')
-rw-r--r-- | src/lib/elementary/elm_inwin.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/lib/elementary/elm_inwin.c b/src/lib/elementary/elm_inwin.c index e50128027e..872d89d64c 100644 --- a/src/lib/elementary/elm_inwin.c +++ b/src/lib/elementary/elm_inwin.c @@ -26,20 +26,10 @@ typedef struct { } Elm_Inwin_Data; EOLIAN static void -_elm_inwin_elm_layout_sizing_eval(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED) +_elm_inwin_efl_canvas_group_calculate(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED) { - Evas_Object *content; - Evas_Coord minw = -1, minh = -1; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - content = elm_layout_content_get(obj, NULL); - - if (!content) return; - - edje_object_size_min_calc(wd->resize_obj, &minw, &minh); - - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); + if (elm_layout_content_get(obj, NULL)) + efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); } EOLIAN static void @@ -132,6 +122,6 @@ ELM_PART_CONTENT_DEFAULT_IMPLEMENT(elm_inwin, Elm_Inwin_Data) #define ELM_INWIN_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_OPS(elm_inwin), \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_inwin) + EFL_CANVAS_GROUP_CALC_OPS(elm_inwin) #include "elm_inwin_eo.c" |