genlist: fix Issue "In Tree effect feature, items floates when number of item crosses...
authorPrince Kr Dubey <prince.dubey@gmail.com>
Mon, 22 Jun 2015 09:51:20 +0000 (11:51 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Mon, 22 Jun 2015 10:36:57 +0000 (12:36 +0200)
Summary: "In Tree effect feature, during expansion of tree, when total number of items crosses block count, items start floating".

Test Plan: Run elementary_test, open Genlist Tree, keep expanding items untill it crosses number of count 32 (Block count). Resize the window, floting items can be seen.

Reviewers: raster, cedric

Subscribers: shilpasingh, poornima.srinivasan, govi, rajeshps

Differential Revision: https://phab.enlightenment.org/D2627

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/elm_genlist.c

index a4936b0..dbd7c3d 100644 (file)
@@ -1067,6 +1067,9 @@ _item_tree_effect_finish(Elm_Genlist_Data *sd)
 {
    Elm_Object_Item *eo_it = NULL;
    const Eina_List *l;
+   Item_Block *itb;
+   Elm_Gen_Item *it1;
+   Evas_Coord y = 0;
 
    if (sd->tree_effect_animator)
      {
@@ -1086,6 +1089,22 @@ _item_tree_effect_finish(Elm_Genlist_Data *sd)
                   edje_object_signal_emit(VIEW(it), SIGNAL_SHOW, "elm");
                }
           }
+        if (sd->move_effect_mode ==
+            ELM_GENLIST_TREE_EFFECT_EXPAND)
+          {
+             EINA_INLIST_FOREACH(sd->blocks, itb)
+               {
+                  EINA_LIST_FOREACH(itb->items, l, it1)
+                   {
+                       if (it1->item->scrl_y <= y)
+                         {
+                            it1->item->scrl_y = y + it1->item->h;
+                            _elm_genlist_item_unrealize(it1, EINA_FALSE);
+                         }
+                       y = it1->item->scrl_y;
+                   }
+               }
+          }
      }
 
    _item_auto_scroll(sd);