From dd32591abd41959d02536be7abc9a31e39c0689e Mon Sep 17 00:00:00 2001 From: Daniel Juyung Seo Date: Sun, 27 Apr 2014 12:55:58 +0900 Subject: [PATCH] genlist: refactor the internal code to make it more readable. --- src/lib/elm_genlist.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 9124d7b..f66e552 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -2592,23 +2592,26 @@ _key_action_move_dir(Evas_Object *obj, Elm_Focus_Direction dir, Eina_Bool multi) (NULL, NULL, NULL, &v), elm_interface_scrollable_content_size_get(NULL, &min)); - if (multi && !_elm_config->item_select_on_focus_disable) + if (_elm_config->item_select_on_focus_disable) { - if (dir == ELM_FOCUS_UP) - ret = _item_multi_select_up(sd); - else if (dir == ELM_FOCUS_DOWN) - ret = _item_multi_select_down(sd); - } - else if (!multi && !_elm_config->item_select_on_focus_disable) - { - if (dir == ELM_FOCUS_UP) - ret = _item_single_select_up(sd); - else if (dir == ELM_FOCUS_DOWN) - ret = _item_single_select_down(sd); + ret = _item_focused_next(obj, dir); } - else if (_elm_config->item_select_on_focus_disable) + else { - ret = _item_focused_next(obj, dir); + if (multi) + { + if (dir == ELM_FOCUS_UP) + ret = _item_multi_select_up(sd); + else if (dir == ELM_FOCUS_DOWN) + ret = _item_multi_select_down(sd); + } + else + { + if (dir == ELM_FOCUS_UP) + ret = _item_single_select_up(sd); + else if (dir == ELM_FOCUS_DOWN) + ret = _item_single_select_down(sd); + } } if (ret) return EINA_TRUE; -- 2.7.4