From 9ff7831eb952e1b2fb5e236c5117e88f530be8c1 Mon Sep 17 00:00:00 2001 From: Wonki Kim Date: Mon, 28 May 2018 21:32:12 +0900 Subject: [PATCH] elementary: Modify key action logic for image.zoomable Summary: 1. remove prior/next action prior/next key action doesn't look suitable for image.zooamble. It is not able to support bi-directional interaction. 2. remove logic that refers to step_size the logic has been removed by applying this commit because api related with step_size has been removed since the new scrollable interface introduced. another patch may follow after discussing on community Reviewers: Hermet Reviewed By: Hermet Subscribers: cedric, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6221 --- src/lib/elementary/efl_ui_image_zoomable.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index dfdbb03..fd379a3 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -975,47 +975,28 @@ _scroll_cb(void * data, static Eina_Bool _key_action_move(Evas_Object *obj, const char *params) { - Eina_Rect view = {}; Eina_Position2D pos = {}; const char *dir = params; EFL_UI_IMAGE_ZOOMABLE_DATA_GET(obj, sd); - Evas_Coord step_x = 0; - Evas_Coord step_y = 0; - Evas_Coord page_y = 0; - + Evas_Coord step = 100; pos = efl_ui_scrollable_content_pos_get(sd->smanager); - view = efl_ui_scrollable_viewport_geometry_get(sd->smanager); if (!strcmp(dir, "left")) { - pos.x -= step_x; + pos.x -= step; } else if (!strcmp(dir, "right")) { - pos.x += step_x; + pos.x += step; } else if (!strcmp(dir, "up")) { - pos.y -= step_y; + pos.y -= step; } else if (!strcmp(dir, "down")) { - pos.y += step_y; - } - else if (!strcmp(dir, "prior")) - { - if (page_y < 0) - pos.y -= -(page_y * view.h) / 100; - else - pos.y -= page_y; - } - else if (!strcmp(dir, "next")) - { - if (page_y < 0) - pos.y += -(page_y * view.h) / 100; - else - pos.y += page_y; + pos.y += step; } else return EINA_FALSE; -- 2.7.4