diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -2399,17 +2399,20 @@ obj = efl_constructor(efl_super(obj, MY_CLASS)); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER); + if (elm_widget_theme_klass_get(obj)) + sd->theme_applied_in_constructor = !efl_ui_widget_theme_apply(obj); return obj; } EOLIAN static Efl_Object* -_efl_ui_layout_base_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED) +_efl_ui_layout_base_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *sd) { Eo *eo, *win; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); eo = efl_finalize(efl_super(obj, MY_CLASS)); - efl_ui_widget_theme_apply(eo); + if (!sd->theme_applied_in_constructor) + efl_ui_widget_theme_apply(eo); win = elm_widget_top_get(obj); if (efl_isa(win, EFL_UI_WIN_CLASS)) diff --git a/src/lib/elementary/elm_widget_layout.h b/src/lib/elementary/elm_widget_layout.h --- a/src/lib/elementary/elm_widget_layout.h +++ b/src/lib/elementary/elm_widget_layout.h @@ -71,6 +71,7 @@ Eina_Bool destructed_is : 1; /**< This flag indicates if Efl.Ui.Layout destructor was called. This is needed to avoid unnecessary calculation of subobject deletion during layout object's deletion. */ Eina_Bool file_set : 1; /**< This flag indicates if Efl.Ui.Layout source is set from a file*/ Eina_Bool automatic_orientation_apply : 1; + Eina_Bool theme_applied_in_constructor : 1; /**< theme_apply succeeded in constructor; skip in finalize */ } Efl_Ui_Layout_Data; /**