elm_interface_scrollable: do not scroll to a focused element by default

this can be done in the implementing other widgets
This commit is contained in:
Marcel Hollerbach 2017-10-19 14:02:11 +02:00
parent f720115f08
commit 3184e0f550
2 changed files with 1 additions and 48 deletions

View File

@ -4657,29 +4657,6 @@ _elm_interface_scrollable_class_constructor(Efl_Class *klass)
EAPI void elm_pan_gravity_set(Elm_Pan *obj EINA_UNUSED, double x EINA_UNUSED, double y EINA_UNUSED) {}
EAPI void elm_pan_gravity_get(const Elm_Pan *obj EINA_UNUSED, double *x EINA_UNUSED, double *y EINA_UNUSED) {}
static void
_focused_element(void *data, const Efl_Event *event)
{
Eina_Rect geom;
Efl_Ui_Focus_Object *obj = data;
Efl_Ui_Focus_Object *focus = event->info;
Elm_Scrollable_Smart_Interface_Data *pd;
Eina_Position2D pos;
int pan_x, pan_y;
pd = efl_data_scope_get(obj, MY_SCROLLABLE_INTERFACE);
if (!focus) return;
geom = efl_ui_focus_object_focus_geometry_get(focus);
pos = efl_gfx_position_get(obj);
elm_obj_pan_pos_get(pd->pan_obj, &pan_x, &pan_y);
geom.x = geom.x + pan_x - pos.x;
geom.y = geom.y + pan_y - pos.y;
elm_interface_scrollable_region_bring_in(obj, geom.x, geom.y, geom.w, geom.h);
}
EOLIAN static Efl_Ui_Focus_Manager*
_elm_interface_scrollable_elm_widget_focus_manager_create(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
{
@ -4699,7 +4676,7 @@ _elm_interface_scrollable_efl_object_constructor(Eo *obj, Elm_Scrollable_Smart_I
efl_composite_attach(obj, pd->manager);
efl_event_callback_add(pd->manager, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, _focused_element, obj);
_efl_ui_focus_manager_redirect_events_add(pd->manager, obj);
return efl_constructor(efl_super(obj, MY_SCROLLABLE_INTERFACE));
}
@ -4726,29 +4703,6 @@ _elm_interface_scrollable_efl_ui_focus_manager_border_elements_get(Eo *obj, Elm_
return eina_iterator_filter_new(border_elements, _filter_cb, free, rect);
}
EOLIAN static void
_elm_interface_scrollable_efl_ui_focus_manager_focus_set(Eo *obj, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *focus)
{
Eina_Rect geom;
Eina_Position2D pos;
int pan_x, pan_y;
EINA_SAFETY_ON_NULL_RETURN(focus);
efl_ui_focus_manager_focus_set(efl_super(obj, MY_SCROLLABLE_INTERFACE), focus);
geom = efl_ui_focus_object_focus_geometry_get(focus);
pos = efl_gfx_position_get(obj);
elm_obj_pan_pos_get(pd->pan_obj, &pan_x, &pan_y);
geom.x = geom.x + pan_x - pos.x;
geom.y = geom.y + pan_y - pos.y;
elm_interface_scrollable_region_bring_in(obj, geom.x, geom.y, geom.w, geom.h);
geom = efl_gfx_geometry_get(obj);
geom.x = geom.y = 0;
elm_widget_show_region_set(obj, geom, EINA_TRUE);
}
EOLIAN static void
_elm_interface_scrollable_item_loop_enabled_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED, Eina_Bool enable EINA_UNUSED)
{

View File

@ -669,7 +669,6 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Ui.Focus.Manager.Sub, Elm.
class.constructor;
Efl.Object.constructor;
Efl.Ui.Focus.Manager.border_elements { get; }
Efl.Ui.Focus.Manager.focus {set; }
Elm.Widget.focus_manager_create;
}
events {