diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index c040d2dcd3..80b97abf63 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -169,6 +169,14 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd) if (!efl_alive_get(obj)) return; + if (sd->calc_subobjs && !evas_smart_objects_calculating_get(evas_object_evas_get(obj))) + { + Eina_List *l; + Eo *subobj; + /* user has manually triggered a smart calc and wants subobjs to also calc */ + EINA_LIST_FOREACH(wd->subobjs, l, subobj) + efl_canvas_group_calculate(subobj); + } elm_coords_finger_size_adjust(sd->finger_size_multiplier_x, &rest_w, sd->finger_size_multiplier_y, &rest_h); if (elm_widget_is_legacy(obj)) @@ -202,6 +210,14 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd) sd->restricted_calc_w = sd->restricted_calc_h = EINA_FALSE; } +void +_efl_ui_layout_subobjs_calc_set(Eo *obj, Eina_Bool set) +{ + Efl_Ui_Layout_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN(sd); + sd->calc_subobjs = !!set; +} + /* common content cases for layout objects: icon and text */ static inline void _signals_emit(Eo *obj, diff --git a/src/lib/elementary/elm_widget_layout.h b/src/lib/elementary/elm_widget_layout.h index 1eb49bb2b3..d9cfa82e56 100644 --- a/src/lib/elementary/elm_widget_layout.h +++ b/src/lib/elementary/elm_widget_layout.h @@ -75,6 +75,7 @@ typedef struct _Elm_Layout_Smart_Data Eina_Bool automatic_orientation_apply : 1; Eina_Bool model_bound : 1; /**< Set to true once we are watching over a model*/ Eina_Bool model_watch : 1; /**< Set to true once we do watch for model change*/ + Eina_Bool calc_subobjs : 1; /**< Set to true if group_calc should also handle subobjs during manual calc */ } Efl_Ui_Layout_Data; /** @@ -88,4 +89,6 @@ typedef struct _Elm_Layout_Smart_Data if (EINA_UNLIKELY(!efl_isa(obj, EFL_UI_LAYOUT_BASE_CLASS))) \ return +void _efl_ui_layout_subobjs_calc_set(Eo *obj, Eina_Bool set); + #endif