Time Gadget: Change the calendar month on mouse wheel.

This commit is contained in:
Stephen okra Houston 2016-11-01 16:13:14 -05:00
parent c3b5c4a1bf
commit e9b270f993
1 changed files with 14 additions and 0 deletions

View File

@ -69,6 +69,18 @@ _clock_month_next_cb(void *data, Evas_Object *obj EINA_UNUSED, const char *emiss
_clock_calendar_month_update(inst);
}
static void
_clock_mouse_wheel_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Instance *inst = data;
Evas_Event_Mouse_Wheel *ev = event_info;
if (ev->z < 0)
_clock_month_prev_cb(inst, NULL, NULL, NULL);
else if (ev->z > 0)
_clock_month_next_cb(inst, NULL, NULL, NULL);
}
static void
_clock_popup_dismissed(void *data EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED)
{
@ -221,6 +233,8 @@ clock_popup_new(Instance *inst)
elm_object_style_set(inst->popup, "noblock");
evas_object_smart_callback_add(inst->popup, "dismissed", _clock_popup_dismissed, inst);
evas_object_event_callback_add(inst->popup, EVAS_CALLBACK_DEL, _clock_popup_del, inst);
evas_object_event_callback_add(inst->popup, EVAS_CALLBACK_MOUSE_WHEEL,
_clock_mouse_wheel_cb, inst);
inst->o_table = elm_table_add(inst->popup);