From b92f13267e15b5cc4f54ed42bba401cacae95c3b Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Wed, 24 Oct 2012 01:06:05 +0000 Subject: [PATCH] dear all, hello. genlist could have LOTS of items. so it would be better to use only displayed items for the focus chain. please check the attachment and give feedback. thanks. cordially, shinwoo kim. SVN revision: 78378 --- src/lib/elm_genlist.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 76b2580..4dac5fa 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -2362,6 +2362,8 @@ _elm_genlist_smart_focus_next(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next) { + Evas_Coord x, y, w, h; + Evas_Coord sx, sy, sw, sh; Item_Block *itb; Eina_List *items = NULL; Eina_Bool done = EINA_FALSE; @@ -2369,6 +2371,8 @@ _elm_genlist_smart_focus_next(const Evas_Object *obj, ELM_GENLIST_CHECK(obj) EINA_FALSE; ELM_GENLIST_DATA_GET(obj, sd); + evas_object_geometry_get(ELM_WIDGET_DATA(sd)->obj, &sx, &sy, &sw, &sh); + EINA_INLIST_FOREACH(sd->blocks, itb) { if (itb->realized) @@ -2380,7 +2384,16 @@ _elm_genlist_smart_focus_next(const Evas_Object *obj, EINA_LIST_FOREACH(itb->items, l, it) { if (it->realized) - items = eina_list_append(items, it->base.access_obj); + { + evas_object_geometry_get(it->base.view, &x, &y, &w, &h); + + /* check item which displays more than half of its size */ + if (((x + (w / 2)) >= sx) && + ((y + (h / 2)) >= sy) && + ((x + (w / 2)) <= (sx + sw)) && + ((y + (h / 2)) <= (sy + sh))) + items = eina_list_append(items, it->base.access_obj); + } } } else if (done) break; -- 2.7.4