hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ec8487a8a4021ecccf50def5f4980d28921d1069

commit ec8487a8a4021ecccf50def5f4980d28921d1069
Author: Minkyu Kang <mk7.k...@samsung.com>
Date:   Thu Sep 1 20:20:53 2016 +0900

    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.k...@samsung.com>
    Signed-off-by: jinwoo.shin <jw0227.s...@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
---
 src/lib/elementary/elm_genlist.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 7c0cc15..5affc55 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -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;
           }
      }

-- 


Reply via email to