elm_spinner.c: support mouse wheel in spinner.

Spinner didn't work with mouse wheel which is a bug.
This fixes T587.
This commit is contained in:
Daniel Juyung Seo 2013-11-28 17:06:39 +09:00
parent e7479334c6
commit 2921e851e1
3 changed files with 22 additions and 1 deletions

View File

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

View File

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

View File

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