From: Hyoyoung Chang <hyoyoung@gmail.com>
authorHyoyoung Chang <hyoyoung@gmail.com>
Mon, 13 Feb 2012 08:50:18 +0000 (08:50 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Mon, 13 Feb 2012 08:50:18 +0000 (08:50 +0000)
Subject: [E-devel] [patch] elm_genlist - bugfix at genlist rotation.

It's about genlist items which are backed from rotation.
After rotating and items width is extending, genlist doesn't shrink its items.
So adding some routines to check if item min width is bigger than genlist's width.
If then recalc items width.

SVN revision: 67876

src/lib/elm_genlist.c

index d5e75be..b3f8bc0 100644 (file)
@@ -2390,7 +2390,7 @@ _calc_job(void *data)
 {
    Widget_Data *wd = data;
    Item_Block *itb, *chb = NULL;
-   Evas_Coord minw = -1, minh = 0, y = 0, ow, dy = 0;
+   Evas_Coord minw = -1, minh = 0, y = 0, ow, dy = 0, vw;
    Evas_Coord pan_w = 0, pan_h = 0;
    int in = 0;
    Eina_Bool minw_change = EINA_FALSE;
@@ -2398,6 +2398,8 @@ _calc_job(void *data)
    if (!wd) return;
 
    evas_object_geometry_get(wd->pan_smart, NULL, NULL, &ow, &wd->h);
+   elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, NULL);
+
    if (wd->w != ow)
      wd->w = ow;
 
@@ -2438,6 +2440,11 @@ _calc_job(void *data)
              minw = itb->minw;
              minw_change = EINA_TRUE;
           }
+        if (minw > vw)
+          {
+             minw = vw;
+             minw_change = EINA_TRUE;
+          }
         itb->w = minw;
         itb->h = itb->minh;
         y += itb->h;