seoz pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=eb9b9635c365692aaca85ac6bb3ed5f4e2112400

commit eb9b9635c365692aaca85ac6bb3ed5f4e2112400
Author: Daniel Juyung Seo <[email protected]>
Date:   Mon Apr 7 03:08:20 2014 +0900

    list: Fixed _elm_list_item_content_focus_set misbehavior.
    
    - Moved a check for direction at the start of the function based on the
    horizontal mode configuration.
    - Removed unnecessary focus set to edje object. In this case, that item
    will get the focus automatically by elm widget item focus
    infrastructure.
    
    But this focus_on_selection feature is still broken. I need to fix them
    more.
---
 src/lib/elm_list.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 5a44e83..bc4a9c8 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -213,6 +213,9 @@ _elm_list_item_content_focus_set(Elm_List_Item *it, 
Elm_Focus_Direction dir,
    ELM_LIST_DATA_GET(WIDGET(it), sd);
 
    if (!sd->focus_on_selection_enabled) return EINA_FALSE;
+   if ((h_mode && (dir != ELM_FOCUS_UP) && (dir != ELM_FOCUS_DOWN)) ||
+       (!h_mode && (dir != ELM_FOCUS_LEFT) && (dir != ELM_FOCUS_RIGHT)))
+     return EINA_FALSE;
 
    int focus_objs = 0;
    Evas_Object *focus_chain[2];
@@ -225,10 +228,7 @@ _elm_list_item_content_focus_set(Elm_List_Item *it, 
Elm_Focus_Direction dir,
      focus_chain[focus_objs++] = it->end;
 
    if (!focus_objs)
-     {
-        elm_object_focus_set(VIEW(it), EINA_TRUE);
-        return EINA_FALSE;
-     }
+     return EINA_FALSE;
 
    for (idx = 0; idx < focus_objs; idx++)
      {
@@ -254,10 +254,6 @@ _elm_list_item_content_focus_set(Elm_List_Item *it, 
Elm_Focus_Direction dir,
              return EINA_TRUE;
           }
 
-        if ((h_mode && (dir != ELM_FOCUS_UP) && (dir != ELM_FOCUS_DOWN)) ||
-            (!h_mode && (dir != ELM_FOCUS_LEFT) && (dir != ELM_FOCUS_RIGHT)))
-               return EINA_FALSE;
-
         idx += ((dir == ELM_FOCUS_UP) || (dir == ELM_FOCUS_LEFT)) ? -1 : 1;
         if (idx < 0) idx = focus_objs - 1;
         if (idx >= focus_objs) idx = 0;

-- 


Reply via email to