elm scroller - also allow animator still to ALSO drive scroll for smoothing

This commit is contained in:
Carsten Haitzler 2013-10-22 11:01:00 +01:00
parent c199bf7b35
commit 498747b16a
2 changed files with 22 additions and 1 deletions

View File

@ -1449,6 +1449,7 @@ _elm_scroll_bounce_eval(Elm_Scrollable_Smart_Interface_Data *sid)
if (sid->down.hold_active)
{
sid->down.hold_active = EINA_FALSE;
ELM_SAFE_FREE(sid->down.hold_animator, ecore_animator_del);
ELM_SAFE_FREE(sid->down.hold_job, ecore_job_del);
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
@ -1772,6 +1773,7 @@ _elm_scroll_content_region_show_internal(Evas_Object *obj,
if (sid->down.hold_active)
{
sid->down.hold_active = EINA_FALSE;
ELM_SAFE_FREE(sid->down.hold_animator, ecore_animator_del);
ELM_SAFE_FREE(sid->down.hold_job, ecore_job_del);
_elm_scroll_drag_stop(sid);
if (sid->content_info.resized)
@ -2587,6 +2589,7 @@ _elm_scroll_mouse_up_event_cb(void *data,
if (sid->down.hold_active)
{
sid->down.hold_active = EINA_FALSE;
ELM_SAFE_FREE(sid->down.hold_animator, ecore_animator_del);
ELM_SAFE_FREE(sid->down.hold_job, ecore_job_del);
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
@ -2672,6 +2675,7 @@ _elm_scroll_mouse_down_event_cb(void *data,
}
if (sid->down.hold_active)
{
ELM_SAFE_FREE(sid->down.hold_animator, ecore_animator_del);
ELM_SAFE_FREE(sid->down.hold_job, ecore_job_del);
_elm_scroll_drag_stop(sid);
if (sid->content_info.resized)
@ -2875,7 +2879,7 @@ _elm_scroll_hold_job(void *data)
Evas_Coord ox = 0, oy = 0, fx = 0, fy = 0;
sid->down.hold_active = EINA_FALSE;
fx = sid->down.hold_x;
fy = sid->down.hold_y;
@ -2984,6 +2988,18 @@ _elm_scroll_hold_job(void *data)
eo_do(sid->obj, elm_scrollable_interface_content_pos_set(ox, oy, EINA_TRUE));
}
static Eina_Bool
_elm_scroll_hold_animator(void *data)
{
Elm_Scrollable_Smart_Interface_Data *sid = data;
if (!sid->down.hold_job)
ecore_job_del(sid->down.hold_job);
sid->down.hold_job =
ecore_job_add(_elm_scroll_hold_job, sid);
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_elm_scroll_on_hold_animator(void *data)
{
@ -3279,6 +3295,9 @@ _elm_scroll_mouse_move_event_cb(void *data,
sid->down.hold_x = x;
sid->down.hold_y = y;
if (!sid->down.hold_animator)
sid->down.hold_animator =
ecore_animator_add(_elm_scroll_hold_animator, sid);
if (!sid->down.hold_job)
ecore_job_del(sid->down.hold_job);
sid->down.hold_job =
@ -4579,6 +4598,7 @@ _elm_scroll_interface_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
if (!sid->extern_pan) evas_object_del(sid->pan_obj);
if (sid->down.hold_job) ecore_job_del(sid->down.hold_job);
if (sid->down.hold_animator) ecore_animator_del(sid->down.hold_animator);
if (sid->down.onhold_animator) ecore_animator_del(sid->down.onhold_animator);
if (sid->down.momentum_animator) ecore_animator_del(sid->down.momentum_animator);
if (sid->down.bounce_x_animator) ecore_animator_del(sid->down.bounce_x_animator);

View File

@ -1120,6 +1120,7 @@ struct _Elm_Scrollable_Smart_Interface_Data
int hdir, vdir;
Ecore_Job *hold_job;
Ecore_Animator *hold_animator;
Ecore_Animator *onhold_animator;
Ecore_Animator *momentum_animator;
Ecore_Animator *bounce_x_animator;