From 33849bea4ce695925dc8be1d57de7f08570d4ab7 Mon Sep 17 00:00:00 2001 From: discomfitor Date: Wed, 30 May 2012 10:44:59 +0000 Subject: [PATCH] also fix selected item scrolling when item prepended to the genlist is offscreen git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@71554 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 Conflicts: src/lib/elm_genlist.c Change-Id: I3424236e265ead16fce0adf60a2eb1b6f4f59791 --- src/lib/elm_genlist.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 81f1bea..ea96887 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -4500,10 +4500,23 @@ _item_process_post(Widget_Data *wd, Elm_Gen_Item *it, Eina_Bool qadd) if (wd->selected && it->item->before) { int y, h; - it = wd->selected->data; + Elm_Gen_Item *it2; + it2 = wd->selected->data; elm_smart_scroller_child_pos_get(wd->scr, NULL, &y); evas_object_geometry_get(wd->pan_smart, NULL, NULL, NULL, &h); - elm_smart_scroller_child_region_show(wd->scr, it->x + it->item->block->x, y + it->item->h, it->item->block->w, h); + if ((it->y + it->item->block->y > y + h) || (it->y + it->item->block->y + it->item->h < y)) + /* offscreen, just update */ + elm_smart_scroller_child_region_show(wd->scr, + it2->x + it2->item->block->x, + y, + it2->item->block->w, + h); + else + elm_smart_scroller_child_region_show(wd->scr, + it->x + it->item->block->x, + y + it->item->h, + it->item->block->w, + h); } } -- 2.7.4