jaehwan pushed a commit to branch master.
commit 81db626bffd1a10d7c39504fd2fd5401d45f9475
Author: Jaehwan Kim <[email protected]>
Date: Tue Jun 18 16:28:06 2013 +0900
In case of scroll in scroll, the child scroller have to bounce if parents
don't have a bounce.
---
ChangeLog | 4 ++++
NEWS | 1 +
src/lib/elm_interface_scrollable.c | 6 ++++--
src/lib/elm_widget.c | 39 ++++++++++++++++++++++++++++++++++++++
src/lib/elm_widget.h | 15 +++++++++++++++
5 files changed, 63 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1361d86..29f141e 100644
--- a/ChangeLog
+++ b/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/NEWS b/NEWS
index c7c5182..d128a96 100644
--- a/NEWS
+++ b/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/src/lib/elm_interface_scrollable.c
b/src/lib/elm_interface_scrollable.c
index cd44735..26a49dc 100644
--- a/src/lib/elm_interface_scrollable.c
+++ b/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/src/lib/elm_widget.c b/src/lib/elm_widget.c
index d2e1166..051a6ab 100644
--- a/src/lib/elm_widget.c
+++ b/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/src/lib/elm_widget.h b/src/lib/elm_widget.h
index f85ec9d..0a24c9e 100644
--- a/src/lib/elm_widget.h
+++ b/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,
@@ -1771,6 +1774,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
*
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev