From 2921e851e1307bba82ce022620880a9de40e8bbe Mon Sep 17 00:00:00 2001 From: Daniel Juyung Seo Date: Thu, 28 Nov 2013 17:06:39 +0900 Subject: [PATCH] elm_spinner.c: support mouse wheel in spinner. Spinner didn't work with mouse wheel which is a bug. This fixes T587. --- legacy/elementary/ChangeLog | 4 ++++ legacy/elementary/NEWS | 1 + legacy/elementary/src/lib/elm_spinner.c | 18 +++++++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index 0f7d397..6703d47 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -1756,3 +1756,7 @@ 2013-11-25 ChunEon Park (Hermet) * image: fix the elm_image_prescale_set() to work properly. + +2013-11-28 Daniel Juyung Seo (SeoZ) + + * spinner: fix mouse wheel support. diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index 740858c..c99ebce 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -157,6 +157,7 @@ Improvements: * Popup: Change the behavior of adding/removing buttons dynamically. User defined button's position is kept. * Fileselector: Monitor and update changes of selected path automatically while EIO is working. * Hoversel: Added focus support on hoversel items. + * Spinner: Support mouse wheel. Fixes: * Now elm_datetime_field_limit_set() can set year limits wihtout problems. diff --git a/legacy/elementary/src/lib/elm_spinner.c b/legacy/elementary/src/lib/elm_spinner.c index 2021f3a..e7c881b 100644 --- a/legacy/elementary/src/lib/elm_spinner.c +++ b/legacy/elementary/src/lib/elm_spinner.c @@ -431,8 +431,10 @@ _elm_spinner_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list) Evas_Object *src = va_arg(*list, Evas_Object *); Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type); - Evas_Event_Key_Down *ev = va_arg(*list, void *); + void *event_info = va_arg(*list, void *); + Evas_Event_Key_Down *ev = event_info; Eina_Bool *ret = va_arg(*list, Eina_Bool *); + Evas_Event_Mouse_Wheel *mev; if (ret) *ret = EINA_FALSE; (void) src; @@ -490,6 +492,20 @@ _elm_spinner_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list) goto success; } + else if (type == EVAS_CALLBACK_MOUSE_WHEEL) + { + mev = event_info; + if (mev->z < 0) + { + _val_inc_start(obj); + elm_layout_signal_emit(obj, "elm,right,anim,activate", "elm"); + } + else + { + _val_dec_start(obj); + elm_layout_signal_emit(obj, "elm,left,anim,activate", "elm"); + } + } return; -- 2.7.4