[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[core/elementary] master 01/01: elm_spinner.c: fixed spinner arrow key bug.



seoz pushed a commit to branch master.

commit 000c554b3fd851f4f3c8c1671b58bd1cd6dbfb23
Author: Daniel Juyung Seo <seojuyung2@gmail.com>
Date:   Sat Sep 14 02:52:52 2013 +0900

    elm_spinner.c: fixed spinner arrow key bug.
    
    Consider the spinner direction for the arrow key events.
---
 ChangeLog             |  4 ++++
 NEWS                  |  1 +
 src/lib/elm_spinner.c | 27 +++++++++++++++++++--------
 3 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4eced13..e4d9780 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1616,3 +1616,7 @@
 
         * elm_object_item : Introduces new APIs, elm_object_item_track(),
         elm_object_item_untrack(), elm_object_item_track_get().
+
+2013-09-14  Daniel Juyung Seo (SeoZ)
+
+        * spinner : fixed arrow key focus movement bug.
diff --git a/NEWS b/NEWS
index 78c1369..ffd4a87 100644
--- a/NEWS
+++ b/NEWS
@@ -281,6 +281,7 @@ Fixes:
    * Flip : Fix the flip page to not flip on a direction if the direction is disabled.
    * Spinner : change part name to access.text from access_text on default style.
    * Fix fileselector only send "selected" signal without selection when file path is typed on the path entry.
+   * Fix spinner arrow key focus movement bug.
 
 Removals:
 
diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c
index 1afe98b..7a91f1a 100644
--- a/src/lib/elm_spinner.c
+++ b/src/lib/elm_spinner.c
@@ -436,6 +436,7 @@ _elm_spinner_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
    void *event_info = va_arg(*list, void *);
    Eina_Bool *ret = va_arg(*list, Eina_Bool *);
    if (ret) *ret = EINA_FALSE;
+   Eina_Bool horz = !!strcmp(elm_widget_style_get(obj), "vertical");
 
    if (elm_widget_disabled_get(obj)) return;
    if (type == EVAS_CALLBACK_KEY_DOWN)
@@ -443,10 +444,15 @@ _elm_spinner_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
         Evas_Event_Key_Down *ev = event_info;
 
         if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
-        else if (!strcmp(ev->key, "Left") ||
-                 ((!strcmp(ev->key, "KP_Left")) && (!ev->string)) ||
-                 !strcmp(ev->key, "Down") ||
-                 ((!strcmp(ev->key, "KP_Down")) && (!ev->string)))
+        else if (
+           ( (!strcmp(ev->key, "Left") ||
+              ((!strcmp(ev->key, "KP_Left")) && (!ev->string)))
+             && horz )
+           ||
+           ( (!strcmp(ev->key, "Down") ||
+              ((!strcmp(ev->key, "KP_Down")) && (!ev->string)))
+             && !horz )
+           )
           {
              _val_dec_start(obj);
              elm_layout_signal_emit(obj, "elm,left,anim,activate", "elm");
@@ -454,10 +460,15 @@ _elm_spinner_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
              if (ret) *ret = EINA_TRUE;
              return;
           }
-        else if (!strcmp(ev->key, "Right") ||
-                 ((!strcmp(ev->key, "KP_Right")) && (!ev->string)) ||
-                 !strcmp(ev->key, "Up") ||
-                 ((!strcmp(ev->key, "KP_Up")) && (!ev->string)))
+        else if (
+           ( (!strcmp(ev->key, "Right") ||
+              ((!strcmp(ev->key, "KP_Right")) && (!ev->string)))
+             && horz )
+           ||
+           ( (!strcmp(ev->key, "Up") ||
+              ((!strcmp(ev->key, "KP_Up")) && (!ev->string)))
+             && !horz )
+           )
           {
              _val_inc_start(obj);
              elm_layout_signal_emit(obj, "elm,right,anim,activate", "elm");

--