From: Daniel Juyung Seo <juyung.seo@samsung.com>
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 31 Jan 2011 08:30:11 +0000 (08:30 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 31 Jan 2011 08:30:11 +0000 (08:30 +0000)
Subject: [E-devel] [Patch] elm_genlist patch for group index handling
and bug fix

I attached a small patch for elm_genlist.c

1. _item_block_position() fix
This patch realizes group index even there is no sub-items.
There was a request about this.
And it shows that there is no sub-items explicitly.

2. Bug Fix
Null check routine was wrong-placed.
I fixed it.

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

src/lib/elm_genlist.c

index b162574..5020233 100644 (file)
@@ -1997,10 +1997,10 @@ _item_block_position(Item_Block *itb,
         it->scrl_x = itb->x + it->x - it->wd->pan_x + ox;
         it->scrl_y = itb->y + it->y - it->wd->pan_y + oy;
 
+        vis = (ELM_RECTS_INTERSECT(it->scrl_x, it->scrl_y, it->w, it->h,
+                                   cvx, cvy, cvw, cvh));
         if (it->flags != ELM_GENLIST_ITEM_GROUP)
           {
-             vis = (ELM_RECTS_INTERSECT(it->scrl_x, it->scrl_y, it->w, it->h,
-                                        cvx, cvy, cvw, cvh));
              if ((itb->realized) && (!it->realized))
                {
                   if (vis) _item_realize(it, in, 0);
@@ -2030,6 +2030,10 @@ _item_block_position(Item_Block *itb,
                }
              in++;
           }
+        else
+          {
+            if (vis) it->want_realize = EINA_TRUE;
+          }
         y += it->h;
      }
 }
@@ -3425,9 +3429,9 @@ elm_genlist_last_item_get(const Evas_Object *obj)
 {
    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
    Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return NULL;
    if (!wd->items) return NULL;
    Elm_Genlist_Item *it = ELM_GENLIST_ITEM_FROM_INLIST(wd->items->last);
-   if (!wd) return NULL;
    while ((it) && (it->delete_me))
      it = ELM_GENLIST_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
    return it;