In case of scroll in scroll, the child scroller have to bounce if parents don't have a bounce.

This commit is contained in:
Jaehwan Kim 2013-06-18 16:28:06 +09:00
parent a070c90ca1
commit a9bd591af9
5 changed files with 63 additions and 2 deletions

View File

@ -1429,3 +1429,7 @@
2013-06-16 ChunEon Park (Hermet)
* Naviframe: Dont' be popped if the event is freezed and popping is going on.
2013-06-18 Jaehwan Kim
* In case of scroll in scroll, the child scroller have to bounce if parents don't have a bounce.

View File

@ -245,6 +245,7 @@ Fixes:
* Remove the keyboard area in the conformant if the keyboard state is off.
* Fix colorselector send "changed" signal twice when pressed color bar.
* Keep the smart members of the naviframe views whenever resize object is changed. This prevents the dangling view objects of the naviframe and keep the layer consistency.
* In case of scroll in scroll, the child scroller have to bounce if parents don't have a bounce.
Removals:

View File

@ -2724,18 +2724,20 @@ _elm_scroll_post_event_move(void *data,
Evas *e __UNUSED__)
{
Elm_Scrollable_Smart_Interface_Data *sid = data;
Eina_Bool horiz, vert;
int start = 0;
if (!sid->down.want_dragged) return EINA_TRUE;
elm_widget_parents_bounce_get(sid->obj, &horiz, &vert);
if (sid->down.hold_parent)
{
if ((sid->down.dir_x) &&
if ((sid->down.dir_x) && horiz &&
!_elm_scroll_can_scroll(sid, sid->down.hdir))
{
sid->down.dir_x = EINA_FALSE;
}
if ((sid->down.dir_y) &&
if ((sid->down.dir_y) && vert &&
!_elm_scroll_can_scroll(sid, sid->down.vdir))
{
sid->down.dir_y = EINA_FALSE;

View File

@ -3473,6 +3473,41 @@ _elm_widget_focus_region_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
*ret = int_ret;
}
EAPI void
elm_widget_parents_bounce_get(Evas_Object *obj,
Eina_Bool *horiz, Eina_Bool *vert)
{
ELM_WIDGET_CHECK(obj);
eo_do((Eo *)obj, elm_wdg_parents_bounce_get(horiz, vert));
}
static void
_elm_widget_parents_bounce_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Eina_Bool *horiz = va_arg(*list, Eina_Bool *);
Eina_Bool *vert = va_arg(*list, Eina_Bool *);
Evas_Object *parent_obj = obj;
Eina_Bool h, v;
*horiz = EINA_FALSE;
*vert = EINA_FALSE;
do
{
parent_obj = elm_widget_parent_get(parent_obj);
if ((!parent_obj) || (!_elm_widget_is(parent_obj))) break;
if (_elm_scrollable_is(parent_obj))
{
eo_do(parent_obj, elm_scrollable_interface_bounce_allow_get(&h, &v));
if (h) *horiz = EINA_TRUE;
if (v) *vert = EINA_TRUE;
}
}
while (parent_obj);
}
EAPI Eina_List *
elm_widget_scrollable_children_get(Evas_Object *obj)
{
@ -5988,6 +6023,8 @@ _class_constructor(Eo_Class *klass)
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SHOW_REGION_SET), _elm_widget_show_region_set),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SHOW_REGION_GET), _elm_widget_show_region_get),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENTS_BOUNCE_GET), _elm_widget_parents_bounce_get),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLLABLE_CHILDREN_GET), _elm_widget_scrollable_children_get),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCALE_SET), _elm_widget_scale_set),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCALE_GET), _elm_widget_scale_get),
@ -6132,6 +6169,8 @@ static const Eo_Op_Description op_desc[] = {
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SHOW_REGION_SET, "description here"),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SHOW_REGION_GET, "description here"),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_PARENTS_BOUNCE_GET, "Get the whether parents have a bounce."),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCROLLABLE_CHILDREN_GET, "description here"),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCALE_SET, "description here"),
EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCALE_GET, "description here"),

View File

@ -664,6 +664,7 @@ EAPI Eina_Bool elm_widget_disabled_get(const Evas_Object *obj);
EAPI void elm_widget_show_region_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool forceshow);
EAPI void elm_widget_show_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
EAPI Eina_Bool elm_widget_focus_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
EAPI void elm_widget_parents_bounce_get(Evas_Object *obj, Eina_Bool *horiz, Eina_Bool *vert);
EAPI void elm_widget_scroll_hold_push(Evas_Object *obj);
EAPI void elm_widget_scroll_hold_pop(Evas_Object *obj);
EAPI int elm_widget_scroll_hold_get(const Evas_Object *obj);
@ -1092,6 +1093,8 @@ enum
ELM_WIDGET_SUB_ID_SHOW_REGION_SET,
ELM_WIDGET_SUB_ID_SHOW_REGION_GET,
ELM_WIDGET_SUB_ID_PARENTS_BOUNCE_GET,
ELM_WIDGET_SUB_ID_SCROLLABLE_CHILDREN_GET,
ELM_WIDGET_SUB_ID_SCALE_SET,
ELM_WIDGET_SUB_ID_SCALE_GET,
@ -1770,6 +1773,18 @@ typedef void * (*list_data_get_func_type)(const Eina_List * l);
*/
#define elm_wdg_show_region_get(x, y, w, h) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SHOW_REGION_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h)
/**
* @def elm_wdg_parents_bounce_get
* @since 1.8
*
* No description supplied by the EAPI.
*
* @param[out] horiz
* @param[out] vert
*
*/
#define elm_wdg_parents_bounce_get(horiz, vert) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENTS_BOUNCE_GET), EO_TYPECHECK(Eina_Bool *, horiz), EO_TYPECHECK(Eina_Bool *, vert)
/**
* @def elm_wdg_scrollable_children_get
* @since 1.8