From 43d82e567a2d655a089b6ca3f2d913e6ec52f1dc Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Sat, 30 Apr 2016 14:26:51 -0400 Subject: [PATCH] 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 0876cf1107..b44b4c617a 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); }