discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=43d82e567a2d655a089b6ca3f2d913e6ec52f1dc

commit 43d82e567a2d655a089b6ca3f2d913e6ec52f1dc
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Sat Apr 30 14:26:51 2016 -0400

    elm_genlist: when appending items to the parent, prepend to the parent
    
    the parent/group item is located after its child items in the list of items,
    so if an item is appended to the parent's list of items then it must be
    prepended to the parent or else it will end up being in the wrong group
    
    @fix
---
 src/lib/elementary/elm_genlist.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 0876cf1..b44b4c6 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -6204,8 +6204,12 @@ _elm_genlist_item_append(Eo *obj EINA_UNUSED, 
Elm_Genlist_Data *sd, const Elm_Ge
           eina_list_append(it->parent->item->items, EO_OBJ(it));
         if (!eo_it2) eo_it2 = EO_OBJ(it->parent);
         ELM_GENLIST_ITEM_DATA_GET(eo_it2, it2);
-        sd->items = eina_inlist_append_relative
-           (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(it2));
+        if (eo_it2 == EO_OBJ(it->parent))
+          sd->items = eina_inlist_prepend_relative
+             (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(it2));
+        else
+          sd->items = eina_inlist_append_relative
+             (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(it2));
         it->item->rel = it2;
         it2->item->rel_revs = eina_list_append(it2->item->rel_revs, it);
      }

-- 


Reply via email to