jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ec670e9a22f0da8ee360642dbe8b426a150093a2
commit ec670e9a22f0da8ee360642dbe8b426a150093a2 Author: Hosang Kim <hosang12....@samsung.com> Date: Thu May 17 18:17:44 2018 +0900 efl_ui_scrollable: apply scroll_hold_push/pop and scroll_freeze_push/pop Test Plan: elementary_test -> Efl.Ui.Scroller -> move slider Reviewers: jpeg, woohyun, akanad, cedric, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: zmike, Jaehyun_Cho, eagle001, cedric Tags: #efl Differential Revision: https://phab.enlightenment.org/D5796 --- src/bin/elementary/test_ui_scroller.c | 3 ++ src/lib/elementary/efl_ui_widget.c | 56 ++++++++++++++++++++++++++++------- 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/src/bin/elementary/test_ui_scroller.c b/src/bin/elementary/test_ui_scroller.c index 5a0a1fc34e..5d9a6898e4 100644 --- a/src/bin/elementary/test_ui_scroller.c +++ b/src/bin/elementary/test_ui_scroller.c @@ -46,6 +46,9 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, 0), efl_content_set(sc, efl_added)); + efl_add(EFL_UI_SLIDER_CLASS, bx, + efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(160, 0)), + efl_pack(bx, efl_added)); for (i = 0; i < 3; i++) { diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index fac32cd4a3..f4c8cc9d7d 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -173,8 +173,12 @@ static inline Eina_Bool _elm_scrollable_is(const Evas_Object *obj) { INTERNAL_ENTRY EINA_FALSE; - return - efl_isa(obj, ELM_INTERFACE_SCROLLABLE_MIXIN); + if (elm_widget_is_legacy(obj)) + return + efl_isa(obj, ELM_INTERFACE_SCROLLABLE_MIXIN); + else + return + efl_isa(obj, EFL_UI_SCROLLABLE_INTERACTIVE_INTERFACE); } static void @@ -2630,7 +2634,12 @@ _efl_ui_widget_scroll_hold_push(Eo *obj, Elm_Widget_Smart_Data *sd) if (sd->scroll_hold == 1) { if (_elm_scrollable_is(obj)) - elm_interface_scrollable_hold_set(obj, EINA_TRUE); + { + if (elm_widget_is_legacy(obj)) + elm_interface_scrollable_hold_set(obj, EINA_TRUE); + else + efl_ui_scrollable_scroll_hold_set(obj, EINA_TRUE); + } else { Evas_Object *child; @@ -2639,7 +2648,10 @@ _efl_ui_widget_scroll_hold_push(Eo *obj, Elm_Widget_Smart_Data *sd) EINA_LIST_FOREACH(sd->subobjs, l, child) { if (elm_widget_is(child) && _elm_scrollable_is(child)) - elm_interface_scrollable_hold_set(child, EINA_TRUE); + if (elm_widget_is_legacy(obj)) + elm_interface_scrollable_hold_set(child, EINA_TRUE); + else + efl_ui_scrollable_scroll_hold_set(child, EINA_TRUE); } } } @@ -2654,7 +2666,12 @@ _efl_ui_widget_scroll_hold_pop(Eo *obj, Elm_Widget_Smart_Data *sd) if (!sd->scroll_hold) { if (_elm_scrollable_is(obj)) - elm_interface_scrollable_hold_set(obj, EINA_FALSE); + { + if (elm_widget_is_legacy(obj)) + elm_interface_scrollable_hold_set(obj, EINA_FALSE); + else + efl_ui_scrollable_scroll_hold_set(obj, EINA_FALSE); + } else { Evas_Object *child; @@ -2663,7 +2680,10 @@ _efl_ui_widget_scroll_hold_pop(Eo *obj, Elm_Widget_Smart_Data *sd) EINA_LIST_FOREACH(sd->subobjs, l, child) { if (elm_widget_is(child) && _elm_scrollable_is(child)) - elm_interface_scrollable_hold_set(child, EINA_FALSE); + if (elm_widget_is_legacy(obj)) + elm_interface_scrollable_hold_set(child, EINA_FALSE); + else + efl_ui_scrollable_scroll_hold_set(child, EINA_FALSE); } } } @@ -2687,7 +2707,12 @@ _efl_ui_widget_scroll_freeze_push(Eo *obj, Elm_Widget_Smart_Data *sd) if (sd->scroll_freeze == 1) { if (_elm_scrollable_is(obj)) - elm_interface_scrollable_freeze_set(obj, EINA_TRUE); + { + if (elm_widget_is_legacy(obj)) + elm_interface_scrollable_freeze_set(obj, EINA_TRUE); + else + efl_ui_scrollable_scroll_freeze_set(obj, EINA_TRUE); + } else { Evas_Object *child; @@ -2696,7 +2721,10 @@ _efl_ui_widget_scroll_freeze_push(Eo *obj, Elm_Widget_Smart_Data *sd) EINA_LIST_FOREACH(sd->subobjs, l, child) { if (elm_widget_is(child) && _elm_scrollable_is(child)) - elm_interface_scrollable_freeze_set(child, EINA_TRUE); + if (elm_widget_is_legacy(obj)) + elm_interface_scrollable_freeze_set(child, EINA_TRUE); + else + efl_ui_scrollable_scroll_freeze_set(child, EINA_TRUE); } } } @@ -2711,7 +2739,12 @@ _efl_ui_widget_scroll_freeze_pop(Eo *obj, Elm_Widget_Smart_Data *sd) if (!sd->scroll_freeze) { if (_elm_scrollable_is(obj)) - elm_interface_scrollable_freeze_set(obj, EINA_FALSE); + { + if (elm_widget_is_legacy(obj)) + elm_interface_scrollable_freeze_set(obj, EINA_FALSE); + else + efl_ui_scrollable_scroll_freeze_set(obj, EINA_FALSE); + } else { Evas_Object *child; @@ -2720,7 +2753,10 @@ _efl_ui_widget_scroll_freeze_pop(Eo *obj, Elm_Widget_Smart_Data *sd) EINA_LIST_FOREACH(sd->subobjs, l, child) { if (elm_widget_is(child) && _elm_scrollable_is(child)) - elm_interface_scrollable_freeze_set(child, EINA_FALSE); + if (elm_widget_is_legacy(obj)) + elm_interface_scrollable_freeze_set(child, EINA_FALSE); + else + efl_ui_scrollable_scroll_freeze_set(child, EINA_FALSE); } } } --