summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-24 13:24:47 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-28 09:39:39 +0100
commit62b3759db553378d57e1d3acb2adba6b504301d7 (patch)
treefcbd31f654c761c7fb687c473e7634296e07757f /src/tests
parent37663b27df81f7251c242f4f359e97e8f04bc115 (diff)
efl_ui_slider: block scrolling when on slider
when a mouse cursor is over a slider, the mouse wheel should be used to affect the state of the slider, not also the one of the slider. ref T2529 Reviewed-by: Bowon Ryu <bowon.ryu@samsung.com> Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com> Differential Revision: https://phab.enlightenment.org/D8455
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/elm_test_slider.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_slider.c b/src/tests/elementary/elm_test_slider.c
index ae9b83ef5c..c5038207d9 100644
--- a/src/tests/elementary/elm_test_slider.c
+++ b/src/tests/elementary/elm_test_slider.c
@@ -41,8 +41,72 @@ EFL_START_TEST(elm_atspi_role_get)
41} 41}
42EFL_END_TEST 42EFL_END_TEST
43 43
44static Evas_Object *fslider, *scroller;
45
46static void
47mag_job(void *e)
48{
49 int x, y, w, h;
50 ck_assert_int_eq(elm_object_scroll_hold_get(scroller), 0);
51 evas_event_feed_mouse_in(e, 0, NULL);
52 evas_object_geometry_get(fslider, &x, &y, &w, &h);
53 evas_event_feed_mouse_move(e, x+w/2, y+h/2, 0, NULL);
54 //ensure that the scroller is on hold
55 ck_assert_int_eq(elm_object_scroll_hold_get(scroller), 1);
56 evas_event_feed_mouse_move(e, x+w+w/2, y+h+h/2, 0, NULL);
57 ck_assert_int_eq(elm_object_scroll_hold_get(scroller), 0);
58 ecore_main_loop_quit();
59}
60
61static void
62norendered(void *data EINA_UNUSED, Evas *e, void *event_info EINA_UNUSED)
63{
64 ecore_job_add(mag_job, e);
65 evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, norendered);
66}
67
68EFL_START_TEST(elm_slider_in_scroller)
69{
70 Evas_Object *win, *slider, *box;
71
72 win = win_add(NULL, "slider", ELM_WIN_BASIC);
73 evas_object_size_hint_weight_set(win, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
74
75 scroller = elm_scroller_add(win);
76 evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
77 evas_object_show(scroller);
78 elm_win_resize_object_add(win, scroller);
79
80 box = elm_box_add(scroller);
81 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
82 elm_object_content_set(scroller, box);
83 evas_object_show(box);
84
85 for (int i = 0; i < 20; ++i)
86 {
87 slider = elm_slider_add(win);
88 evas_object_size_hint_weight_set(slider, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
89 elm_slider_min_max_set(slider, 0, 100);
90 evas_object_show(slider);
91 elm_box_pack_end(box, slider);
92 if (i == 0)
93 fslider = slider;
94 }
95 elm_scroller_page_bring_in(scroller, 0, 0);
96 evas_object_resize(win, 100, 100);
97 evas_object_show(win);
98
99 evas_smart_objects_calculate(evas_object_evas_get(win));
100 evas_event_callback_add(evas_object_evas_get(win), EVAS_CALLBACK_RENDER_POST, norendered, NULL);
101
102 elm_run();
103
104}
105EFL_END_TEST
106
44void elm_test_slider(TCase *tc) 107void elm_test_slider(TCase *tc)
45{ 108{
46 tcase_add_test(tc, elm_slider_legacy_type_check); 109 tcase_add_test(tc, elm_slider_legacy_type_check);
110 tcase_add_test(tc, elm_slider_in_scroller);
47 tcase_add_test(tc, elm_atspi_role_get); 111 tcase_add_test(tc, elm_atspi_role_get);
48} 112}