elm_genlist: apply the item_select_on_focus_disable feature on key_action_move

Summary:
Previously, focused item was always selected on first and last key action.
If item_select_on_focus_disable is true, item should not be selected.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>

Test Plan: elementary_test -to genlist

Reviewers: cedric, SanghyeonLee, Hermet

Reviewed By: Hermet

Subscribers: sju27, seoz, jpeg

Differential Revision: https://phab.enlightenment.org/D4272
This commit is contained in:
Minkyu Kang 2016-09-01 20:20:53 +09:00 committed by Hermet Park
parent 1d2be3fc4c
commit ec8487a8a4
1 changed files with 18 additions and 2 deletions

View File

@ -3033,7 +3033,15 @@ _key_action_move(Evas_Object *obj, const char *params)
it = elm_genlist_first_item_get(obj);
if (it)
{
elm_genlist_item_selected_set(it, EINA_TRUE);
if (_elm_config->item_select_on_focus_disable)
{
elm_object_item_focus_set(it, EINA_TRUE);
elm_genlist_item_show(it, ELM_GENLIST_ITEM_SCROLLTO_TOP);
}
else
{
elm_genlist_item_selected_set(it, EINA_TRUE);
}
return EINA_TRUE;
}
}
@ -3042,7 +3050,15 @@ _key_action_move(Evas_Object *obj, const char *params)
it = elm_genlist_last_item_get(obj);
if (it)
{
elm_genlist_item_selected_set(it, EINA_TRUE);
if (_elm_config->item_select_on_focus_disable)
{
elm_object_item_focus_set(it, EINA_TRUE);
elm_genlist_item_show(it, ELM_GENLIST_ITEM_SCROLLTO_BOTTOM);
}
else
{
elm_genlist_item_selected_set(it, EINA_TRUE);
}
return EINA_TRUE;
}
}