elementary: Modify key action logic for image.zoomable
authorWonki Kim <wonki_.kim@samsung.com>
Mon, 28 May 2018 12:32:12 +0000 (21:32 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Fri, 1 Jun 2018 05:17:53 +0000 (14:17 +0900)
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

index dfdbb03..fd379a3 100644 (file)
@@ -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;