scroller: fix getting content position.

Summary:
Widgets that don't have content like as genlist, gengrid.
They don't have geometry of content also.
So position of pan will be used when calculating postion to scroll.

Test Plan:
tested in elementary_test and check working properly.
this may be the problem when extern pan set on scrollable interface.

Reviewers: SanghyeonLee, cedric, felipealmeida, larry, bu5hm4n

Reviewed By: SanghyeonLee

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5127
This commit is contained in:
Hosang Kim 2017-08-25 14:53:09 +09:00 committed by SangHyeon Jade Lee
parent af1f4157f2
commit 4b74a4cd55
1 changed files with 4 additions and 5 deletions

View File

@ -4727,17 +4727,16 @@ 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_Rectangle geom;
Eina_Rectangle obj_geom;
int pan_x, pan_y;
efl_ui_focus_manager_focus_set(efl_super(obj, MY_SCROLLABLE_INTERFACE), focus);
if (!focus) return;
evas_object_geometry_get(focus, &geom.x, &geom.y, &geom.w, &geom.h);
evas_object_geometry_get(pd->content, &obj_geom.x, &obj_geom.y, &obj_geom.w, &obj_geom.h);
geom.x = geom.x - obj_geom.x;
geom.y = geom.y - obj_geom.y;
elm_obj_pan_pos_get(pd->pan_obj, &pan_x, &pan_y);
geom.x = geom.x + pan_x;
geom.y = geom.y + pan_y;
elm_interface_scrollable_region_bring_in(obj, geom.x, geom.y, geom.w, geom.h);
}