From 5cac1baf1faf4b0fe56b95630648371f2c29dc3b Mon Sep 17 00:00:00 2001 From: Amitesh Singh Date: Fri, 9 Jun 2017 14:14:46 +0900 Subject: [PATCH] elm-test: ui.image.zoomable: make anim example to work with zoom mousewheel can be used to zoom in and zoom out. --- src/bin/elementary/test_photocam.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c index f38bcd6..26c520f 100644 --- a/src/bin/elementary/test_photocam.c +++ b/src/bin/elementary/test_photocam.c @@ -745,7 +745,7 @@ _zoomable_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info void test_photocam_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - Evas_Object *win, *bx, *lbl, *zoomable; + Evas_Object *win, *bx, *lbl, *zoomable, *rect; char buf[PATH_MAX]; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); @@ -777,6 +777,17 @@ test_photocam_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi evas_object_show(zoomable); evas_object_smart_callback_add(zoomable, "clicked", _zoomable_clicked_cb, NULL); + rect = evas_object_rectangle_add(evas_object_evas_get(win)); + evas_object_color_set(rect, 0, 0, 0, 0); + evas_object_repeat_events_set(rect, EINA_TRUE); + evas_object_show(rect); + evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_WHEEL, _photocam_mouse_wheel_cb, zoomable); + evas_object_raise(rect); + + // add move/resize callbacks to resize rect manually + evas_object_event_callback_add(zoomable, EVAS_CALLBACK_RESIZE, _photocam_move_resize_cb, rect); + evas_object_event_callback_add(zoomable, EVAS_CALLBACK_MOVE, _photocam_move_resize_cb, rect); + evas_object_resize(win, 320, 320); evas_object_show(win); } -- 2.7.4