cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=834dd49944d3ac161c55eeae161fff26b4789015

commit 834dd49944d3ac161c55eeae161fff26b4789015
Author: Jee-Yong Um <jc9...@samsung.com>
Date:   Thu Jun 23 10:09:13 2016 -0700

    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 <ced...@osg.samsung.com>
---
 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 ac67e68..4974762 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;

-- 


Reply via email to