genlist prepends no longer cause selected items to be autoscrolled out of the viewport
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 29 May 2012 10:25:55 +0000 (10:25 +0000)
committerTae-Hwan Kim <the81.kim@samsung.com>
Thu, 12 Jul 2012 07:00:27 +0000 (16:00 +0900)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@71500 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

Conflicts:

ChangeLog

Change-Id: Ice451be414c0e87b7b3514f7bff37531e2115a3c

src/lib/elm_genlist.c

index 3bbaacc..4c7b1e4 100644 (file)
@@ -4480,6 +4480,18 @@ _item_process_post(Widget_Data *wd, Elm_Gen_Item *it, Eina_Bool qadd)
           }
      }
    if (showme) it->item->block->showme = EINA_TRUE;
+   /* when prepending, move the scroller along with the first selected item to
+    * create the illusion that we're watching the selected item
+    * this prevents the selected item being scrolled off the viewport
+    */
+   if (wd->selected && it->item->before)
+     {
+        int y, h;
+        it = 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);
+     }
 }
 
 static int