forked from enlightenment/edi
optimise edge case checking
This commit is contained in:
parent
a744f48420
commit
687af9c86f
|
@ -57,13 +57,16 @@ edi_mainview_item_prev()
|
|||
current = elm_naviframe_top_item_get(nf);
|
||||
first = (Edi_Mainview_Item *)eina_list_nth(_edi_mainview_items, 0);
|
||||
|
||||
if (first->view == current)
|
||||
{
|
||||
prev = eina_list_nth(_edi_mainview_items, eina_list_count(_edi_mainview_items)-1);
|
||||
edi_mainview_item_select(prev);
|
||||
return;
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH(_edi_mainview_items, item, it)
|
||||
{
|
||||
if (first->view == current)
|
||||
{
|
||||
prev = eina_list_nth(_edi_mainview_items, eina_list_count(_edi_mainview_items)-1);
|
||||
edi_mainview_item_select(prev);
|
||||
}
|
||||
|
||||
if (it && it->view == current)
|
||||
{
|
||||
if (prev)
|
||||
|
@ -86,13 +89,16 @@ edi_mainview_item_next()
|
|||
current = elm_naviframe_top_item_get(nf);
|
||||
last = eina_list_nth(_edi_mainview_items, eina_list_count(_edi_mainview_items)-1);
|
||||
|
||||
if (last->view == current)
|
||||
{
|
||||
next = eina_list_nth(_edi_mainview_items, 0);
|
||||
edi_mainview_item_select(next);
|
||||
return;
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH(_edi_mainview_items, item, it)
|
||||
{
|
||||
if (last->view == current)
|
||||
{
|
||||
next = eina_list_nth(_edi_mainview_items, 0);
|
||||
edi_mainview_item_select(next);
|
||||
}
|
||||
|
||||
if (it && open_next)
|
||||
{
|
||||
edi_mainview_item_select(it);
|
||||
|
|
Loading…
Reference in New Issue