[elm_genlist.c] refactoring homogeneous check code
authorSeunggyun Kim <sgyun.kim@samsung.com>
Tue, 29 Mar 2011 05:12:51 +0000 (14:12 +0900)
committerSeunggyun Kim <sgyun.kim@samsung.com>
Tue, 29 Mar 2011 05:16:41 +0000 (14:16 +0900)
Change-Id: Ia386d23647e976a18296dc48179c67d234eea436

src/lib/elm_genlist.c

index 84d22cc..320fe47 100644 (file)
@@ -822,6 +822,7 @@ _theme_hook(Evas_Object *obj)
                                        elm_widget_style_get(obj));
 //   edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
    wd->item_width = wd->item_height = 0;
+   wd->group_item_width = wd->group_item_height = 0;
    wd->minw = wd->minh = wd->realminw = 0;
    EINA_INLIST_FOREACH(wd->blocks, itb)
    {
@@ -1962,7 +1963,7 @@ _item_realize(Elm_Genlist_Item *it,
           }
      }
 
-   if ((calc) && (it->wd->homogeneous) && (it->wd->item_width) && it->wd->group_item_width )
+   if ((calc) && (it->wd->homogeneous) && ((it->wd->item_width) || ((it->wd->item_width) && (it->wd->group_item_width))))
      {
         /* homogenous genlist shortcut */
          if ((it->flags & ELM_GENLIST_ITEM_GROUP) && (!it->mincalcd))
@@ -2069,25 +2070,16 @@ _item_realize(Elm_Genlist_Item *it,
              it->h = it->minh = mh;
              it->mincalcd = EINA_TRUE;
 
-             if ((it->wd->homogeneous) && (it->flags & ELM_GENLIST_ITEM_GROUP))
-               {
-                  it->wd->group_item_width = mw;
-                  it->wd->group_item_height = mh;
-               }
-             else  if ((it->wd->homogeneous))
-          //   if ((!in) && (it->wd->homogeneous))
+             if ((!it->wd->group_item_width) && (it->flags == ELM_GENLIST_ITEM_GROUP))
+               {
+                  it->wd->group_item_width = mw;
+                  it->wd->group_item_height = mh;
+               }
+             else if ((!it->wd->item_width) && (it->flags == ELM_GENLIST_ITEM_NONE))
                {
                   it->wd->item_width = mw;
                   it->wd->item_height = mh;
                }
-             if ((!in) && (it->wd->homogeneous) && (!it->wd->group_item_width))
-               {
-                  if (it->flags & ELM_GENLIST_ITEM_GROUP)
-                       {
-                           it->wd->group_item_width = mw;
-                           it->wd->group_item_height = mh;
-                        }
-               }
           }
         if (!calc) evas_object_show(it->base.view);
      }