Toolbar: fix retrieval of previous state

There should be no problem that the prev_state is the first state.
The last state should be returned only if there is nothing before the
current state.

@fix
This commit is contained in:
Daniel Zaoui 2016-11-08 14:40:50 +02:00
parent 4e828b4f13
commit 7957041d84
1 changed files with 1 additions and 1 deletions

View File

@ -3818,7 +3818,7 @@ _elm_toolbar_item_state_prev(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *ite
if (!item->states) return NULL;
prev_state = eina_list_prev(item->current_state);
if ((!prev_state) || (prev_state == item->states))
if (!prev_state)
prev_state = eina_list_last(item->states);
return eina_list_data_get(prev_state);
}