forked from enlightenment/efl
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:
parent
6e54c58b9c
commit
c4e03dcea4
|
@ -241,12 +241,18 @@ _focused_element(void *data, const Efl_Event *event)
|
||||||
|
|
||||||
EOLIAN static Eo *
|
EOLIAN static Eo *
|
||||||
_efl_ui_scroller_efl_object_constructor(Eo *obj,
|
_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))
|
if (!elm_widget_theme_klass_get(obj))
|
||||||
elm_widget_theme_klass_set(obj, "scroller");
|
elm_widget_theme_klass_set(obj, "scroller");
|
||||||
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
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;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,10 +264,6 @@ _efl_ui_scroller_efl_object_finalize(Eo *obj,
|
||||||
|
|
||||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
|
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);
|
sd->pan_obj = efl_add(EFL_UI_PAN_CLASS, obj);
|
||||||
|
|
||||||
efl_ui_scroll_manager_pan_set(sd->smanager, sd->pan_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);
|
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_event_callback_add(sd->pan_obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED,
|
||||||
_efl_ui_scroller_pan_resized_cb, obj);
|
_efl_ui_scroller_pan_resized_cb, obj);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue