summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_layout.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_layout.c
parent586f41f92772ab789364bcd788e7717f92ba86de (diff)
downloadefl-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/efl_ui_layout.c')
-rw-r--r--src/lib/elementary/efl_ui_layout.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index 80b97abf63..cde03e3213 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -206,7 +206,7 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd)
elm_coords_finger_size_adjust(sd->finger_size_multiplier_x, NULL,
sd->finger_size_multiplier_y, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
-
+ efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
sd->restricted_calc_w = sd->restricted_calc_h = EINA_FALSE;
}
@@ -529,6 +529,11 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd)
(theme_apply_internal_ret == EFL_UI_THEME_APPLY_ERROR_DEFAULT))
return EFL_UI_THEME_APPLY_ERROR_DEFAULT;
+ /* unset existing size hints to force accurate recalc */
+ efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(0, 0));
+ if (elm_widget_is_legacy(obj))
+ efl_gfx_hint_size_min_set(obj, EINA_SIZE2D(0, 0));
+
return EFL_UI_THEME_APPLY_ERROR_NONE;
}
@@ -2531,6 +2536,7 @@ _efl_ui_layout_base_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNU
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
eo = efl_finalize(efl_super(obj, MY_CLASS));
efl_ui_widget_theme_apply(eo);
+ efl_canvas_group_change(obj);
win = elm_widget_top_get(obj);
if (efl_isa(win, EFL_UI_WIN_CLASS))