From 5ac0024ebd4e4a1854de17d7a3908259612538a4 Mon Sep 17 00:00:00 2001 From: Dave Andreoli Date: Tue, 17 Apr 2018 00:11:11 +0200 Subject: [PATCH] Revert "Genlist: restore old behaviour of item next/prev in group items" This reverts commit f0a0da9f449b0878fe6a5ce2abc50b8b6589c50a. As per T5938 seems we really want to restore a totally wrong behaviour, without taking care of newer apps being broken. I revert this for now, but I'm still convinced that we must find a way to let user use a sane ordering for newer app. I'm thinking about adding an api in genlist to let the widget use the new sane ordering, something like elm_genlist_fixed_ordering_set(bool) so that new apps can use this to ensure correct behaviour. zmike what do you think about this solution? --- src/lib/elementary/elm_genlist.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c index 08e5d86..97bf2d8 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c @@ -7192,12 +7192,6 @@ _elm_genlist_next_item_get_insane(Elm_Genlist_Data *sd, Elm_Gen_Item *it) if (sd->filter && !_item_filtered_get(it2)) continue; - // Insanity does not apply for group items - // (group and normal items was treated in a flat way) - if (it->item->type == ELM_GENLIST_ITEM_GROUP || - it2->item->type == ELM_GENLIST_ITEM_GROUP) - return EO_OBJ(it2); - // 1. Return next sibling in list, if any if (it->parent == it2->parent) return EO_OBJ(it2); @@ -7221,7 +7215,7 @@ _elm_genlist_next_item_get_insane(Elm_Genlist_Data *sd, Elm_Gen_Item *it) return EO_OBJ(it->parent); } /* if item is already last item, return its parent if a parent exists */ - if (it->parent && it->parent->item->type != ELM_GENLIST_ITEM_GROUP) + if (it->parent) return EO_OBJ(it->parent); return EO_OBJ(it2); } @@ -7241,16 +7235,6 @@ _elm_genlist_prev_item_get_insane(Elm_Genlist_Data *sd, Elm_Gen_Item *it) return EO_OBJ(it2); } - // Insanity does not apply for group items - // (group and normal items was treated in a flat way) - if (it->item->type == ELM_GENLIST_ITEM_GROUP) - { - for (it2 = ELM_GEN_ITEM_PREV(it); it2; it2 = ELM_GEN_ITEM_PREV(it2)) - if (!sd->filter || _item_filtered_get(it2)) - break; - return EO_OBJ(it2); - } - parent = it->parent; if (!parent) { @@ -7270,7 +7254,7 @@ _elm_genlist_prev_item_get_insane(Elm_Genlist_Data *sd, Elm_Gen_Item *it) } it2 = ELM_GEN_ITEM_PREV(it); - if (it2 == parent && it2->item->type != ELM_GENLIST_ITEM_GROUP) + if (it2 == parent) return _elm_genlist_prev_item_get_insane(sd, it2); return EO_OBJ(it2); -- 2.7.4