From 44b6018d540e84c236f98250695b1432a9a35aec Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 25 Aug 2020 10:40:47 +0100 Subject: [PATCH] elm scroller - fix mapping of block enums - was broken --- src/lib/elementary/efl_ui_textbox.c | 6 +++--- src/lib/elementary/elm_interface_scrollable.h | 2 +- src/lib/elementary/elm_scroller.c | 20 +++++++++++--------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/lib/elementary/efl_ui_textbox.c b/src/lib/elementary/efl_ui_textbox.c index d19a769..a358fe9 100644 --- a/src/lib/elementary/efl_ui_textbox.c +++ b/src/lib/elementary/efl_ui_textbox.c @@ -540,7 +540,7 @@ _dnd_drop_cb(void *data EINA_UNUSED, const Efl_Event *ev) { Eina_Future *future; - future = efl_ui_dnd_drop_data_get(ev->object, evas_device_seat_id_get(evas_default_device_get(evas_object_evas_get(ev->object), EFL_INPUT_DEVICE_TYPE_SEAT)), eina_array_iterator_new(types)); + future = efl_ui_dnd_drop_data_get(ev->object, evas_device_seat_id_get(evas_default_device_get(evas_object_evas_get(ev->object), EVAS_DEVICE_CLASS_SEAT)), eina_array_iterator_new(types)); efl_future_then(ev->object, future, _selection_data_cb); } @@ -860,7 +860,7 @@ _selection_store(Efl_Ui_Cnp_Buffer buffer, content = eina_content_new((Eina_Slice)EINA_SLICE_STR_FULL(sel), "application/x-elementary-markup"); - efl_ui_selection_set(obj, buffer, content, evas_device_seat_id_get(evas_default_device_get(evas_object_evas_get(obj), EFL_INPUT_DEVICE_TYPE_SEAT))); + efl_ui_selection_set(obj, buffer, content, evas_device_seat_id_get(evas_default_device_get(evas_object_evas_get(obj), EVAS_DEVICE_CLASS_SEAT))); free(sel); } @@ -1981,7 +1981,7 @@ _efl_ui_textbox_selection_paste_type(Eo *obj, Efl_Ui_Textbox_Data *sd, Efl_Ui_Cn Eina_Future *future; Eina_Array *types = _figure_out_types(obj, sd); - future = efl_ui_selection_get(obj, type, evas_device_seat_id_get(evas_default_device_get(evas_object_evas_get(obj), EFL_INPUT_DEVICE_TYPE_SEAT)), eina_array_iterator_new(types)); + future = efl_ui_selection_get(obj, type, evas_device_seat_id_get(evas_default_device_get(evas_object_evas_get(obj), EVAS_DEVICE_CLASS_SEAT)), eina_array_iterator_new(types)); efl_future_then(obj, future, _selection_data_cb); diff --git a/src/lib/elementary/elm_interface_scrollable.h b/src/lib/elementary/elm_interface_scrollable.h index d7772b7..f808346 100644 --- a/src/lib/elementary/elm_interface_scrollable.h +++ b/src/lib/elementary/elm_interface_scrollable.h @@ -77,7 +77,7 @@ struct _Elm_Scrollable_Smart_Interface_Data Elm_Scroller_Policy hbar_flags, vbar_flags; Elm_Scroller_Single_Direction one_direction_at_a_time; - Elm_Scroller_Movement_Block block; + Efl_Ui_Layout_Orientation block; //TIZEN_ONLY(20190710): Tunning scroll in case user wants to move just 1 item. float velocity_under_threshold; diff --git a/src/lib/elementary/elm_scroller.c b/src/lib/elementary/elm_scroller.c index fc658b0..a72d793 100644 --- a/src/lib/elementary/elm_scroller.c +++ b/src/lib/elementary/elm_scroller.c @@ -1493,10 +1493,10 @@ elm_scroller_movement_block_set(Evas_Object *obj, Efl_Ui_Layout_Orientation mode = EFL_UI_LAYOUT_ORIENTATION_DEFAULT; // legacy -> eo - if (block == ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL) - mode = EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL; - else if (block == ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL) - mode = EFL_UI_LAYOUT_ORIENTATION_VERTICAL; + if (block & ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL) + mode |= EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL; + if (block & ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL) + mode |= EFL_UI_LAYOUT_ORIENTATION_VERTICAL; elm_interface_scrollable_movement_block_set(obj, mode); } @@ -1505,18 +1505,20 @@ EAPI Elm_Scroller_Movement_Block elm_scroller_movement_block_get(const Evas_Object *obj) { Efl_Ui_Layout_Orientation mode; + Elm_Scroller_Movement_Block mode2 = 0; ELM_SCROLLABLE_CHECK(obj, ELM_SCROLLER_MOVEMENT_NO_BLOCK); mode = elm_interface_scrollable_movement_block_get(obj); // eo -> legacy - if (mode == EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL) - return ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL; - else if (mode == EFL_UI_LAYOUT_ORIENTATION_VERTICAL) - return ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL; + if (mode & EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL) + mode2 |= ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL; + else if (mode & EFL_UI_LAYOUT_ORIENTATION_VERTICAL) + mode2 |= ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL; - return ELM_SCROLLER_MOVEMENT_NO_BLOCK; + if (mode2 == 0) return ELM_SCROLLER_MOVEMENT_NO_BLOCK; + return mode2; } EAPI void -- 2.7.4