summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_panel.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-07-30 13:11:48 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-07-30 13:12:52 -0400
commit7e517e2a1196207bbfe76ce9ab12be3093d9afc5 (patch)
tree106c98b6ad2720f0504b7d254e4efdfcd4cec253 /src/lib/elementary/efl_ui_panel.c
parent586f41f92772ab789364bcd788e7717f92ba86de (diff)
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/efl_ui_panel.c')
-rw-r--r--src/lib/elementary/efl_ui_panel.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/lib/elementary/efl_ui_panel.c b/src/lib/elementary/efl_ui_panel.c
index eba318d..cad4a8f 100644
--- a/src/lib/elementary/efl_ui_panel.c
+++ b/src/lib/elementary/efl_ui_panel.c
@@ -53,10 +53,8 @@ _mirrored_set(Evas_Object *obj,
53} 53}
54 54
55EOLIAN static void 55EOLIAN static void
56_efl_ui_panel_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Panel_Data *sd) 56_efl_ui_panel_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Panel_Data *sd)
57{ 57{
58 Evas_Coord mw = 0, mh = 0;
59
60 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 58 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
61 59
62 if (sd->delete_me) return; 60 if (sd->delete_me) return;
@@ -67,10 +65,7 @@ _efl_ui_panel_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Panel_Data *sd)
67 else _drawer_open(obj, wd->w, wd->h, EINA_FALSE); 65 else _drawer_open(obj, wd->w, wd->h, EINA_FALSE);
68 } 66 }
69 67
70 evas_object_smart_calculate(sd->bx); 68 efl_canvas_group_calculate(efl_super(obj, MY_CLASS));
71 edje_object_size_min_calc(wd->resize_obj, &mw, &mh);
72 evas_object_size_hint_min_set(obj, mw, mh);
73 evas_object_size_hint_max_set(obj, -1, -1);
74} 69}
75 70
76static char * 71static char *
@@ -863,6 +858,9 @@ _efl_ui_panel_efl_object_constructor(Eo *obj, Efl_Ui_Panel_Data *_pd)
863 else 858 else
864 { 859 {
865 elm_layout_content_set(obj, "efl.content", _pd->bx); 860 elm_layout_content_set(obj, "efl.content", _pd->bx);
861 /* trigger box recalc on manual panel calc */
862 _efl_ui_layout_subobjs_calc_set(obj, EINA_TRUE);
863 efl_ui_layout_finger_size_multiplier_set(obj, 0, 0);
866 864
867 if (edje_object_part_exists 865 if (edje_object_part_exists
868 (wd->resize_obj, "efl.swallow.event")) 866 (wd->resize_obj, "efl.swallow.event"))
@@ -1404,7 +1402,4 @@ _efl_ui_panel_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED
1404 1402
1405/* Internal EO APIs and hidden overrides */ 1403/* Internal EO APIs and hidden overrides */
1406 1404
1407#define EFL_UI_PANEL_EXTRA_OPS \
1408 ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_panel)
1409
1410#include "efl_ui_panel.eo.c" 1405#include "efl_ui_panel.eo.c"