diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index 1361d86aa6..29f141efa5 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -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. diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index c7c5182976..d128a962e4 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -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: diff --git a/legacy/elementary/src/lib/elm_interface_scrollable.c b/legacy/elementary/src/lib/elm_interface_scrollable.c index cd44735a76..26a49dc183 100644 --- a/legacy/elementary/src/lib/elm_interface_scrollable.c +++ b/legacy/elementary/src/lib/elm_interface_scrollable.c @@ -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; diff --git a/legacy/elementary/src/lib/elm_widget.c b/legacy/elementary/src/lib/elm_widget.c index d2e11660d9..051a6abb3c 100644 --- a/legacy/elementary/src/lib/elm_widget.c +++ b/legacy/elementary/src/lib/elm_widget.c @@ -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"), diff --git a/legacy/elementary/src/lib/elm_widget.h b/legacy/elementary/src/lib/elm_widget.h index f85ec9da7e..0a24c9ec6a 100644 --- a/legacy/elementary/src/lib/elm_widget.h +++ b/legacy/elementary/src/lib/elm_widget.h @@ -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