genlist: fixed wrong item focus set on item_focus_set API call.

Reset the last_focused_item on _item_focus_set_hook.
This fixes the issue which sets the focus to the wrong item when the
focus is set by an API.

Reproduction step:
elementary_test -> genlist focus -> click an item (not the 2nd item) -> click "Focus 2nd
Item after 1.5 seconds" button.
Focus is not moved to the 2nd item.

@fix
This commit is contained in:
Daniel Juyung Seo 2014-05-26 21:56:10 +09:00
parent d9f0509b5e
commit 7357290056
4 changed files with 4 additions and 0 deletions

View File

@ -2930,6 +2930,7 @@ _item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused)
if (focused)
{
sd->last_focused_item = it;
if (!elm_object_focus_get(obj))
elm_object_focus_set(obj, EINA_TRUE);

View File

@ -5670,6 +5670,7 @@ _item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused)
if (focused)
{
sd->last_focused_item = it;
if (!elm_object_focus_get(obj))
elm_object_focus_set(obj, EINA_TRUE);

View File

@ -1946,6 +1946,7 @@ _item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused)
if (focused)
{
sd->last_focused_item = it;
if (!elm_object_focus_get(obj))
elm_object_focus_set(obj, EINA_TRUE);
if (it != sd->focused_item)

View File

@ -806,6 +806,7 @@ _item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused)
if (focused)
{
sd->last_focused_item = it;
if (!elm_object_focus_get(obj))
elm_object_focus_set(obj, EINA_TRUE);
if (it != (Elm_Object_Item *)sd->focused_item)