cedric pushed a commit to branch master.

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

commit 8800fbc8394547e2a5c904b696328d493faa644a
Author: divyesh purohit <div.puro...@samsung.com>
Date:   Fri Jan 22 11:00:20 2016 -0800

    combobox: "return" key handled correctly and removed unreachable code.
    
    Summary:
    
    _key_action_activate was triggered when "return" was pressed, 
_key_action_move
    contained the "return" key handling, which is unreachable code.
    @fix T3075 (1st point).
    
    Signed-off-by: divyesh purohit <div.puro...@samsung.com>
    
    Test Plan: please run combobox example in elementary_test
    
    Reviewers: shilpasingh, cedric, raster
    
    Subscribers: rajeshps, govi
    
    Maniphest Tasks: T3075
    
    Differential Revision: https://phab.enlightenment.org/D3599
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/lib/elc_combobox.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/lib/elc_combobox.c b/src/lib/elc_combobox.c
index cb2a835..3d1a808 100644
--- a/src/lib/elc_combobox.c
+++ b/src/lib/elc_combobox.c
@@ -384,9 +384,7 @@ _key_action_move(Evas_Object *obj, const char *params)
    const char *dir = params;
    if (!sd->hover) return EINA_FALSE;
 
-   if (!strcmp(dir, "return"))
-     eo_do(obj, eo_event_callback_call(ELM_COMBOBOX_EVENT_CLICKED, NULL));
-   else if (!strcmp(dir, "up"))
+   if (!strcmp(dir, "up"))
      {
         it = sd->item;
         it = elm_genlist_item_prev_get(it);
@@ -409,7 +407,15 @@ _key_action_move(Evas_Object *obj, const char *params)
 static Eina_Bool
 _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
 {
-   elm_combobox_hover_begin(obj);
+   ELM_COMBOBOX_DATA_GET(obj, sd);
+   if (!sd->expanded)
+     elm_combobox_hover_begin(obj);
+   else
+     {
+        eo_do(sd->genlist, 
eo_event_callback_call(EVAS_CLICKABLE_INTERFACE_EVENT_PRESSED,
+                                                  sd->item));
+        elm_entry_cursor_end_set(sd->entry);
+     }
    return EINA_TRUE;
 }
 

-- 


Reply via email to