elm_spinner.c: fixed spinner arrow key bug.

Consider the spinner direction for the arrow key events.
This commit is contained in:
Daniel Juyung Seo 2013-09-14 02:52:52 +09:00
parent d12ad3fbf1
commit 1a3660fd8e
3 changed files with 24 additions and 8 deletions

View File

@ -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.

View File

@ -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:

View File

@ -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");