diff options
author | Jehun Lim <jehun.lim@samsung.com> | 2015-09-07 16:13:37 +0900 |
---|---|---|
committer | Jehun Lim <jehun.lim@samsung.com> | 2015-09-07 16:13:37 +0900 |
commit | 4f66c5f49a440340f3de101f20803574d702e6e4 (patch) | |
tree | 94287c1cefc07d57b2005a7d34d7ed3472187360 | |
parent | 27043b4645801eb912071bc829f999eb8b91e071 (diff) | |
download | air_mediahub-4f66c5f49a440340f3de101f20803574d702e6e4.tar.gz air_mediahub-4f66c5f49a440340f3de101f20803574d702e6e4.tar.bz2 air_mediahub-4f66c5f49a440340f3de101f20803574d702e6e4.zip |
listmgr: add key down callback for play info index button
Change-Id: Id856d5ddc0583d4894e26279b04bd6ea95309452
Signed-off-by: Jehun Lim <jehun.lim@samsung.com>
-rw-r--r-- | src/util/listmgr.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/util/listmgr.c b/src/util/listmgr.c index 876f137..cc11c19 100644 --- a/src/util/listmgr.c +++ b/src/util/listmgr.c @@ -72,11 +72,8 @@ static void _index_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *ei) !strcmp(ev->keyname, KEY_BACK_REMOTE)) { elm_object_focus_next(obj, ELM_FOCUS_UP); } else if (!strcmp(ev->keyname, KEY_DOWN)) { - if (lmgr->play_info == lmgr->focused) - return; - grid = elm_object_part_content_get(lmgr->focused, - PART_ITEM_CONTENT); + PART_ITEM_CONTENT); it = elm_gengrid_first_item_get(grid); if (it) elm_object_item_focus_set(it, EINA_TRUE); @@ -120,6 +117,11 @@ static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj, lmgr = data; switch (id) { + case LISTMGR_INDEX: + if (!strcmp(ev->keyname, KEY_BACK) || + !strcmp(ev->keyname, KEY_BACK_REMOTE)) + elm_object_focus_next(obj, ELM_FOCUS_UP); + break; case LISTMGR_PLAY_INFO: case LISTMGR_GRID: if (!strcmp(ev->keyname, KEY_BACK) || @@ -295,7 +297,7 @@ static input_handler _handler = { .focused = _focused_cb }; -static input_handler _idx_handler = { +static input_handler _grid_idx_handler = { .mouse_move = _mouse_move_cb, .clicked = _clicked_cb, .focused = _focused_cb @@ -350,7 +352,7 @@ static bool _draw_play_info(struct listmgr *lmgr) index = elm_object_part_content_get(ly, PART_ITEM_TITLE); - inputmgr_add_callback(index, LISTMGR_INDEX, &_idx_handler, lmgr); + inputmgr_add_callback(index, LISTMGR_INDEX, &_handler, lmgr); elm_object_focus_next_object_set(index, lmgr->data->menu_btn, ELM_FOCUS_UP); @@ -385,7 +387,7 @@ static Evas_Object *_add_list_item_button(struct listmgr *lmgr, lmgr->data->menu_btn, ELM_FOCUS_UP); elm_object_focus_next_object_set(btn, btn, ELM_FOCUS_DOWN); - inputmgr_add_callback(btn, LISTMGR_INDEX, &_idx_handler, lmgr); + inputmgr_add_callback(btn, LISTMGR_INDEX, &_grid_idx_handler, lmgr); evas_object_event_callback_priority_add(btn, EVAS_CALLBACK_KEY_DOWN, EVAS_CALLBACK_PRIORITY_AFTER, _index_key_down_cb, lmgr); @@ -821,7 +823,7 @@ void listmgr_destroy(struct listmgr *lmgr) content = elm_object_part_content_get(lmgr->play_info, PART_ITEM_CONTENT); - inputmgr_remove_callback(btn, &_idx_handler); + inputmgr_remove_callback(btn, &_handler); inputmgr_remove_callback(content, &_handler); elm_object_signal_callback_del(content, SIG_ITEM_SELECTED, @@ -836,7 +838,7 @@ void listmgr_destroy(struct listmgr *lmgr) btn = elm_object_part_content_get(ly, PART_ITEM_TITLE); grid = elm_object_part_content_get(ly, PART_ITEM_CONTENT); - inputmgr_remove_callback(btn, &_idx_handler); + inputmgr_remove_callback(btn, &_grid_idx_handler); inputmgr_remove_callback(grid, &_grid_handler); } |