From 834dd49944d3ac161c55eeae161fff26b4789015 Mon Sep 17 00:00:00 2001 From: Jee-Yong Um Date: Thu, 23 Jun 2016 10:09:13 -0700 Subject: [PATCH] genlist: scroll to item when calc is done Summary: If elm_genlist_item_bring_in() is called immediately after appending item, genlist will not scroll to the last one but stop in the middle. This patch blocks genlist from scrolling to not calculated item. Test Plan: 1. Download F31560 and uncompress the file 2. make 3. ./test Reviewers: SanghyeonLee Subscribers: cedric, DaveMDS, jpeg Differential Revision: https://phab.enlightenment.org/D4023 Signed-off-by: Cedric BAIL --- src/lib/elementary/elm_genlist.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c index ac67e68ed3..4974762f0a 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c @@ -581,6 +581,8 @@ _item_scroll(Elm_Genlist_Data *sd) dw = it->item->block->w; dh = oh; + if (dw < 1) return; + switch (sd->scroll_to_type) { case ELM_GENLIST_ITEM_SCROLLTO_TOP: @@ -6947,6 +6949,19 @@ _elm_genlist_item_coordinates_calc(Elm_Gen_Item *it, return EINA_FALSE; } } + if (it->item->block->w < 1) + { + sd->check_scroll = EINA_TRUE; + sd->show_item = it; + sd->bring_in = bring_in; + sd->scroll_to_type = type; + it->item->show_me = EINA_TRUE; + + ecore_job_del(sd->calc_job); + sd->calc_job = ecore_job_add(_calc_job, sd->obj); + + return EINA_FALSE; + } if (sd->show_item) { sd->show_item->item->show_me = EINA_FALSE;