From a6cc94321176700b5bfb89b85d71c33461180f22 Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Fri, 5 Apr 2019 04:05:37 +0000 Subject: [PATCH] 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 Differential Revision: https://phab.enlightenment.org/D8559 --- src/lib/elementary/efl_ui_list.c | 6 ++---- src/lib/elementary/efl_ui_scroller.c | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib/elementary/efl_ui_list.c b/src/lib/elementary/efl_ui_list.c index 2b2b077f24..1cb6f1061e 100644 --- a/src/lib/elementary/efl_ui_list.c +++ b/src/lib/elementary/efl_ui_list.c @@ -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); diff --git a/src/lib/elementary/efl_ui_scroller.c b/src/lib/elementary/efl_ui_scroller.c index 5891e422f9..0fef382346 100644 --- a/src/lib/elementary/efl_ui_scroller.c +++ b/src/lib/elementary/efl_ui_scroller.c @@ -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);