fix interactive flip so it works again! :/
SVN revision: 74796
This commit is contained in:
parent
07bfc8e14d
commit
4c25cbcb47
|
@ -127,6 +127,7 @@ _elm_flip_smart_sub_object_add(Evas_Object *obj,
|
|||
if (!ELM_WIDGET_CLASS(_elm_flip_parent_sc)->sub_object_add(obj, sobj))
|
||||
return EINA_FALSE;
|
||||
|
||||
evas_object_smart_member_add(sobj, obj);
|
||||
//FIXME: smart member clip could be reset by the obj.
|
||||
evas_object_event_callback_add
|
||||
(sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints_cb, obj);
|
||||
|
@ -1222,6 +1223,8 @@ _flip(Evas_Object *obj)
|
|||
if (t > 1.0) t = 1.0;
|
||||
|
||||
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
||||
if (!sd->manual)
|
||||
{
|
||||
if (sd->mode == ELM_FLIP_PAGE_LEFT)
|
||||
{
|
||||
sd->dir = 0;
|
||||
|
@ -1272,9 +1275,11 @@ _flip(Evas_Object *obj)
|
|||
}
|
||||
else
|
||||
_flip_do(obj, t, sd->mode, 0, 0);
|
||||
}
|
||||
|
||||
if (t >= 1.0)
|
||||
{
|
||||
#if 0 // this breaks manual flipping. :/
|
||||
if (sd->state == sd->next_state)
|
||||
{
|
||||
/* it was flipped while flipping, do it again */
|
||||
|
@ -1282,7 +1287,7 @@ _flip(Evas_Object *obj)
|
|||
sd->state = !sd->next_state;
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
#endif
|
||||
sd->pageflip = EINA_FALSE;
|
||||
_state_end(sd);
|
||||
evas_object_map_enable_set(sd->front.content, 0);
|
||||
|
@ -1293,6 +1298,7 @@ _flip(Evas_Object *obj)
|
|||
evas_smart_objects_calculate(evas_object_evas_get(obj));
|
||||
// FIXME: end hack
|
||||
sd->animator = NULL;
|
||||
if (((sd->manual) && (sd->finish)) || (!sd->manual))
|
||||
sd->state = sd->next_state;
|
||||
_configure(obj);
|
||||
_flip_show_hide(obj);
|
||||
|
@ -1471,7 +1477,7 @@ _event_anim(void *data,
|
|||
(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
|
||||
// FIXME: end hack
|
||||
sd->animator = NULL;
|
||||
if (sd->finish) sd->state = !sd->state;
|
||||
if (sd->finish) sd->state = sd->next_state;
|
||||
_flip_show_hide(ELM_WIDGET_DATA(sd)->obj);
|
||||
_configure(ELM_WIDGET_DATA(sd)->obj);
|
||||
sd->animator = NULL;
|
||||
|
@ -1590,12 +1596,15 @@ _up_cb(void *data,
|
|||
tm = 1.0 - ((double)sd->y / (double)sd->h);
|
||||
}
|
||||
if (tm < 0.01) tm = 0.01;
|
||||
else if (tm > 0.99)
|
||||
tm = 0.99;
|
||||
else if (tm > 0.99) tm = 0.99;
|
||||
if (!sd->finish) tm = 1.0 - tm;
|
||||
else sd->next_state = !sd->state;
|
||||
tm *= 1.0; // FIXME: config for anim time
|
||||
if (sd->animator) ecore_animator_del(sd->animator);
|
||||
sd->animator = ecore_animator_timeline_add(tm, _event_anim, sd);
|
||||
sd->len = tm;
|
||||
sd->start = ecore_loop_time_get();
|
||||
sd->manual = EINA_TRUE;
|
||||
_event_anim(sd, 0.0);
|
||||
}
|
||||
|
||||
|
@ -1901,6 +1910,7 @@ _elm_flip_go_to(Elm_Flip_Smart_Data *sd,
|
|||
sd->start = ecore_loop_time_get();
|
||||
sd->next_state = front;
|
||||
sd->len = 0.5; // FIXME: make config val
|
||||
sd->manual = EINA_FALSE;
|
||||
if ((sd->mode == ELM_FLIP_PAGE_LEFT) ||
|
||||
(sd->mode == ELM_FLIP_PAGE_RIGHT) ||
|
||||
(sd->mode == ELM_FLIP_PAGE_UP) ||
|
||||
|
|
|
@ -150,6 +150,7 @@ struct _Elm_Flip_Smart_Data
|
|||
Eina_Bool started : 1;
|
||||
Eina_Bool backflip : 1;
|
||||
Eina_Bool pageflip : 1;
|
||||
Eina_Bool manual : 1;
|
||||
};
|
||||
|
||||
typedef struct _Vertex2 Vertex2;
|
||||
|
|
Loading…
Reference in New Issue