efl_ui/scroller: create scroll manager in constructor

this fixes setting scroller properties during construction

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9593
This commit is contained in:
Mike Blumenkrantz 2019-08-16 15:08:14 -04:00 committed by Cedric BAIL
parent 6e54c58b9c
commit c4e03dcea4
1 changed files with 7 additions and 6 deletions

View File

@ -241,12 +241,18 @@ _focused_element(void *data, const Efl_Event *event)
EOLIAN static Eo *
_efl_ui_scroller_efl_object_constructor(Eo *obj,
Efl_Ui_Scroller_Data *sd EINA_UNUSED)
Efl_Ui_Scroller_Data *sd)
{
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "scroller");
obj = efl_constructor(efl_super(obj, MY_CLASS));
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);
efl_ui_scroll_connector_bind(obj, sd->smanager);
return obj;
}
@ -258,10 +264,6 @@ _efl_ui_scroller_efl_object_finalize(Eo *obj,
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
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);
sd->pan_obj = efl_add(EFL_UI_PAN_CLASS, obj);
efl_ui_scroll_manager_pan_set(sd->smanager, sd->pan_obj);
@ -269,7 +271,6 @@ _efl_ui_scroller_efl_object_finalize(Eo *obj,
elm_widget_can_focus_set(obj, EINA_TRUE);
efl_ui_scroll_connector_bind(obj, sd->smanager);
efl_event_callback_add(sd->pan_obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED,
_efl_ui_scroller_pan_resized_cb, obj);