summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen okra Houston <smhouston88@gmail.com>2016-11-01 16:13:14 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-11-18 11:36:23 -0500
commite0699c06405f2aac0fa585b849ed947238f6bcc6 (patch)
treec11f09433b4baa12ed08cbb2290f6d8559df3080
parentb3db41fad7098823c396a3b279d2a9f7c2d7645b (diff)
Time Gadget: Change the calendar month on mouse wheel.
-rw-r--r--src/modules/time/clock.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/modules/time/clock.c b/src/modules/time/clock.c
index 64eb7db5e..c52d2b6a7 100644
--- a/src/modules/time/clock.c
+++ b/src/modules/time/clock.c
@@ -70,6 +70,18 @@ _clock_month_next_cb(void *data, Evas_Object *obj EINA_UNUSED, const char *emiss
70} 70}
71 71
72static void 72static void
73_clock_mouse_wheel_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
74{
75 Instance *inst = data;
76 Evas_Event_Mouse_Wheel *ev = event_info;
77
78 if (ev->z < 0)
79 _clock_month_prev_cb(inst, NULL, NULL, NULL);
80 else if (ev->z > 0)
81 _clock_month_next_cb(inst, NULL, NULL, NULL);
82}
83
84static void
73_clock_popup_dismissed(void *data EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED) 85_clock_popup_dismissed(void *data EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED)
74{ 86{
75 evas_object_del(obj); 87 evas_object_del(obj);
@@ -221,6 +233,8 @@ clock_popup_new(Instance *inst)
221 elm_object_style_set(inst->popup, "noblock"); 233 elm_object_style_set(inst->popup, "noblock");
222 evas_object_smart_callback_add(inst->popup, "dismissed", _clock_popup_dismissed, inst); 234 evas_object_smart_callback_add(inst->popup, "dismissed", _clock_popup_dismissed, inst);
223 evas_object_event_callback_add(inst->popup, EVAS_CALLBACK_DEL, _clock_popup_del, inst); 235 evas_object_event_callback_add(inst->popup, EVAS_CALLBACK_DEL, _clock_popup_del, inst);
236 evas_object_event_callback_add(inst->popup, EVAS_CALLBACK_MOUSE_WHEEL,
237 _clock_mouse_wheel_cb, inst);
224 238
225 inst->o_table = elm_table_add(inst->popup); 239 inst->o_table = elm_table_add(inst->popup);
226 240