summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchris <chris@indefini.org>2015-11-04 16:16:11 -0800
committerCedric BAIL <cedric@osg.samsung.com>2015-11-04 16:23:32 -0800
commit99288a9e35f9ea2dec5aa63d43ec996dd4e976c5 (patch)
treeaa2fd8f219a7595a69c5363f8b8a9070acbf545c
parent5cfe1cff12645a94a9fd529f560125e1716d213a (diff)
autoscroll focus: pass the object region position relative to the scroller.
Summary: The region position passed to region_show and region_bring_in used to be relative to the object position, not the scroller. This fixes T1686. @fix Reviewers: seoz Maniphest Tasks: T1686 Differential Revision: https://phab.enlightenment.org/D3168 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/elm_widget.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 832ea1e75..c850e4656 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -762,22 +762,30 @@ _elm_widget_focus_region_show(const Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNU
762 while (o) 762 while (o)
763 { 763 {
764 Evas_Coord px, py; 764 Evas_Coord px, py;
765 evas_object_geometry_get(o, &px, &py, NULL, NULL);
765 766
766 if (_elm_scrollable_is(o) && !elm_widget_disabled_get(o)) 767 if (_elm_scrollable_is(o) && !elm_widget_disabled_get(o))
767 { 768 {
769 Evas_Coord sx, sy;
770 eo_do(o, elm_interface_scrollable_content_region_get(&sx, &sy, NULL, NULL));
771
772 // Get the object's on_focus_region position relative to the scroller.
773 Evas_Coord rx, ry;
774 rx = ox + x - px + sx;
775 ry = oy + y - py + sy;
776
768 switch (_elm_config->focus_autoscroll_mode) 777 switch (_elm_config->focus_autoscroll_mode)
769 { 778 {
770 case ELM_FOCUS_AUTOSCROLL_MODE_SHOW: 779 case ELM_FOCUS_AUTOSCROLL_MODE_SHOW:
771 eo_do(o, elm_interface_scrollable_content_region_show(x, y, w, h)); 780 eo_do(o, elm_interface_scrollable_content_region_show(rx, ry, w, h));
772 break; 781 break;
773 case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN: 782 case ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN:
774 eo_do(o, elm_interface_scrollable_region_bring_in(x, y, w, h)); 783 eo_do(o, elm_interface_scrollable_region_bring_in(rx, ry, w, h));
775 break; 784 break;
776 default: 785 default:
777 break; 786 break;
778 } 787 }
779 788
780
781 if (!elm_widget_focus_region_get(o, &x, &y, &w, &h)) 789 if (!elm_widget_focus_region_get(o, &x, &y, &w, &h))
782 { 790 {
783 o = elm_widget_parent_get(o); 791 o = elm_widget_parent_get(o);
@@ -786,7 +794,6 @@ _elm_widget_focus_region_show(const Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNU
786 } 794 }
787 else 795 else
788 { 796 {
789 evas_object_geometry_get(o, &px, &py, NULL, NULL);
790 x += ox - px; 797 x += ox - px;
791 y += oy - py; 798 y += oy - py;
792 ox = px; 799 ox = px;