forked from enlightenment/efl
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
This commit is contained in:
parent
e451522ac3
commit
68b2ea66ea
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue