forked from enlightenment/efl
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
This commit is contained in:
parent
55cd0f4970
commit
843850154d
|
@ -962,47 +962,28 @@ _scroll_cb(void * data,
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_key_action_move(Evas_Object *obj, const char *params)
|
_key_action_move(Evas_Object *obj, const char *params)
|
||||||
{
|
{
|
||||||
Eina_Rect view = {};
|
|
||||||
Eina_Position2D pos = {};
|
Eina_Position2D pos = {};
|
||||||
const char *dir = params;
|
const char *dir = params;
|
||||||
EFL_UI_IMAGE_ZOOMABLE_DATA_GET(obj, sd);
|
EFL_UI_IMAGE_ZOOMABLE_DATA_GET(obj, sd);
|
||||||
|
|
||||||
Evas_Coord step_x = 0;
|
Evas_Coord step = 100;
|
||||||
Evas_Coord step_y = 0;
|
|
||||||
Evas_Coord page_y = 0;
|
|
||||||
|
|
||||||
pos = efl_ui_scrollable_content_pos_get(sd->smanager);
|
pos = efl_ui_scrollable_content_pos_get(sd->smanager);
|
||||||
view = efl_ui_scrollable_viewport_geometry_get(sd->smanager);
|
|
||||||
|
|
||||||
if (!strcmp(dir, "left"))
|
if (!strcmp(dir, "left"))
|
||||||
{
|
{
|
||||||
pos.x -= step_x;
|
pos.x -= step;
|
||||||
}
|
}
|
||||||
else if (!strcmp(dir, "right"))
|
else if (!strcmp(dir, "right"))
|
||||||
{
|
{
|
||||||
pos.x += step_x;
|
pos.x += step;
|
||||||
}
|
}
|
||||||
else if (!strcmp(dir, "up"))
|
else if (!strcmp(dir, "up"))
|
||||||
{
|
{
|
||||||
pos.y -= step_y;
|
pos.y -= step;
|
||||||
}
|
}
|
||||||
else if (!strcmp(dir, "down"))
|
else if (!strcmp(dir, "down"))
|
||||||
{
|
{
|
||||||
pos.y += step_y;
|
pos.y += step;
|
||||||
}
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
else return EINA_FALSE;
|
else return EINA_FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue