elementary: fix not to call duplicate theme set

Theme is set during finalize in Efl.Ui.Layout_Base.
Therefore, it is not necessary to call theme set function if the widget
inherits Efl.Ui.Layout_Base and its klass is properly set.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8559
This commit is contained in:
Jaehyun Cho 2019-04-05 04:05:37 +00:00 committed by Cedric BAIL
parent 3e7017e6a8
commit a6cc943211
2 changed files with 4 additions and 6 deletions

View File

@ -413,6 +413,8 @@ _efl_ui_list_size_hint_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED)
EOLIAN static Eo *
_efl_ui_list_efl_object_constructor(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED)
{
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "list");
obj = efl_constructor(efl_super(obj, MY_CLASS));
return obj;
@ -426,10 +428,6 @@ _efl_ui_list_efl_object_finalize(Eo *obj,
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
Eina_Error theme_apply_ret = efl_ui_layout_theme_set(obj, "list", "base", efl_ui_widget_style_get(obj));
if (theme_apply_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC)
CRI("list(%p) failed to set theme [efl/list:%s]!", obj, efl_ui_widget_style_get(obj) ?: "NULL");
pd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj);
efl_ui_mirrored_set(pd->smanager, efl_ui_mirrored_get(obj));
efl_composite_attach(obj, pd->smanager);

View File

@ -550,6 +550,8 @@ EOLIAN static Eo *
_efl_ui_scroller_efl_object_constructor(Eo *obj,
Efl_Ui_Scroller_Data *sd EINA_UNUSED)
{
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "scroller");
obj = efl_constructor(efl_super(obj, MY_CLASS));
return obj;
@ -563,8 +565,6 @@ _efl_ui_scroller_efl_object_finalize(Eo *obj,
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
efl_ui_layout_theme_set(obj, "scroller", "base", efl_ui_widget_style_get(obj));
sd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj);
efl_ui_mirrored_set(sd->smanager, efl_ui_mirrored_get(obj));
efl_composite_attach(obj, sd->smanager);