Elementary genlist: Enabling _show_region_hook to handle the genlist item sub
authorseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 13 Feb 2011 10:28:55 +0000 (10:28 +0000)
committerseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 13 Feb 2011 10:28:55 +0000 (10:28 +0000)
objects hierarchical region show. Scroller pan geometry is included, as scrolelr
is smart object, not in genlist hierarchy.
Patch By Govindaraju SM <govi.sm@samsung.com>

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@56981 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_genlist.c

index 52f3e93..d078052 100644 (file)
@@ -447,7 +447,7 @@ static void      _item_cache_zero(Widget_Data *wd);
 static void      _del_hook(Evas_Object *obj);
 static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
 static void      _theme_hook(Evas_Object *obj);
-//static void _show_region_hook(void *data, Evas_Object *obj);
+static void      _show_region_hook(void *data, Evas_Object *obj);
 static void      _sizing_eval(Evas_Object *obj);
 static void      _item_unrealize(Elm_Genlist_Item *it);
 static void      _item_block_unrealize(Item_Block *itb);
@@ -763,17 +763,18 @@ _theme_hook(Evas_Object *obj)
    _sizing_eval(obj);
 }
 
-/*
-   static void
-   _show_region_hook(void *data, Evas_Object *obj)
-   {
+static void
+_show_region_hook(void *data, Evas_Object *obj)
+{
    Widget_Data *wd = elm_widget_data_get(data);
    Evas_Coord x, y, w, h;
    if (!wd) return;
    elm_widget_show_region_get(obj, &x, &y, &w, &h);
+   //x & y are screen coordinates, Add with pan coordinates
+   x += wd->pan_x;
+   y += wd->pan_y;
    elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
-   }
- */
+}
 
 static void
 _sizing_eval(Evas_Object *obj)
@@ -2616,6 +2617,7 @@ elm_genlist_add(Evas_Object *parent)
    elm_widget_theme_hook_set(obj, _theme_hook);
    elm_widget_can_focus_set(obj, EINA_TRUE);
    elm_widget_event_hook_set(obj, _event_hook);
+   elm_widget_on_show_region_hook_set(obj, _show_region_hook, obj);
 
    wd->scr = elm_smart_scroller_add(e);
    elm_smart_scroller_widget_set(wd->scr, obj);