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
This commit is contained in:
Mike Blumenkrantz 2016-04-30 14:26:51 -04:00
parent 5c933b0176
commit 43d82e567a
1 changed files with 6 additions and 2 deletions

View File

@ -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);
}