aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/elementary
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-28 14:17:28 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-04 08:45:49 +0100
commit80bdbc8b54a03d94573a63836d5d6d191dc9384f (patch)
treec54f00e4714b3d6778ce8275868200a57142dec2 /src/bin/elementary
parentefl_ui_focus_manager_root_focus: ensure that adapter is part of viewport (diff)
downloadefl-80bdbc8b54a03d94573a63836d5d6d191dc9384f.tar.gz
elm_scroller: update behaviour to match legacy behaviour more closely
This implements scrolling the scroller when the scroller is not in the maximum position of the requested relation, but there is no more focus object in that relation. Summing up, the scroller is scrolled manually, when the focus object is not fitting in the viewport, and the object is beeing out of the viewport in the requested direction. Or the scroller is not at its max position in the requested direction, and there is no more focusable object in this requested direction. ref https://phab.enlightenment.org/T6804 Differential Revision: https://phab.enlightenment.org/D7382
Diffstat (limited to 'src/bin/elementary')
-rw-r--r--src/bin/elementary/test.c2
-rw-r--r--src/bin/elementary/test_scroller.c72
2 files changed, 74 insertions, 0 deletions
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index f44052f216..1cedec20ac 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -180,6 +180,7 @@ void test_scroller3(void *data, Evas_Object *obj, void *event_info);
void test_scroller4(void *data, Evas_Object *obj, void *event_info);
void test_scroller5(void *data, Evas_Object *obj, void *event_info);
void test_scroller6(void *data, Evas_Object *obj, void *event_info);
+void test_scroller7(void *data, Evas_Object *obj, void *event_info);
void test_efl_ui_scroller(void *data, Evas_Object *obj, void *event_info);
void test_efl_ui_scroller2(void *data, Evas_Object *obj, void *event_info);
void test_spinner(void *data, Evas_Object *obj, void *event_info);
@@ -1062,6 +1063,7 @@ add_tests:
ADD_TEST(NULL, "Scroller", "Page Scroller", test_scroller4);
ADD_TEST(NULL, "Scroller", "Scroller on Popup", test_scroller5);
ADD_TEST(NULL, "Scroller", "Scroller 6", test_scroller6);
+ ADD_TEST(NULL, "Scroller", "Scroller 7", test_scroller7);
ADD_TEST_EO(NULL, "Scroller", "Efl.Ui.Scroller", test_efl_ui_scroller);
//------------------------------//
diff --git a/src/bin/elementary/test_scroller.c b/src/bin/elementary/test_scroller.c
index ef8ef7e49c..7ca95955fe 100644
--- a/src/bin/elementary/test_scroller.c
+++ b/src/bin/elementary/test_scroller.c
@@ -1061,3 +1061,75 @@ test_scroller6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
evas_object_resize(win, 400, 550);
evas_object_show(win);
}
+
+void
+test_scroller7(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Evas_Object *win, *scr, *lb, *table, *btn, *btn2, *inner_table, *o, *inner_button;
+
+ win = elm_win_util_standard_add("Scroller with unfocusable content", "Scroller with unfocusable content");
+ elm_win_autodel_set(win, EINA_TRUE);
+ elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
+
+ table = elm_table_add(win);
+ evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_win_resize_object_add(win, table);
+ evas_object_show(table);
+
+ scr = elm_scroller_add(win);
+ evas_object_size_hint_weight_set(scr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(scr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_table_pack(table, scr, 0, 0, 1, 1);
+ evas_object_show(scr);
+
+ inner_table = o = elm_table_add(win);
+ evas_object_size_hint_weight_set(scr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(scr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_content_set(scr, inner_table);
+ evas_object_show(scr);
+
+ lb = elm_label_add(scr);
+ elm_object_text_set(lb, "Enlightenment started out way back in 1996 as a project to build a Window Manager for X11. It has grown much more since then. Enlightenment still produces this Window Manager, but it has evolved to also cover Mobile, Wearable and TV UI requirements for projects such as Tizen as well as the traditional “desktop” UI. We still push out releases. See our download page for more details on the this. Visit our contribute page for our latest source code repositories. The project is currently transitioning from X11 to Wayland. We are fully committed to moving to Wayland eventually, as its the future of graphical display layers on Linux. We still primarily support Linux for Enlightenment, but there is some effort (based on help and support from users and some developers) to support BSD too.");
+ elm_table_pack(inner_table, lb, 0, 1, 1, 1);
+ evas_object_show(lb);
+
+ lb = elm_label_add(scr);
+ elm_object_text_set(lb, "Enlightenment started out way back in 1996 as a project to build a Window Manager for X11. It has grown much more since then. Enlightenment still produces this Window Manager, but it has evolved to also cover Mobile, Wearable and TV UI requirements for projects such as Tizen as well as the traditional “desktop” UI. We still push out releases. See our download page for more details on the this. Visit our contribute page for our latest source code repositories. The project is currently transitioning from X11 to Wayland. We are fully committed to moving to Wayland eventually, as its the future of graphical display layers on Linux. We still primarily support Linux for Enlightenment, but there is some effort (based on help and support from users and some developers) to support BSD too.");
+ elm_table_pack(inner_table, lb, 1, 0, 1, 1);
+ evas_object_show(lb);
+
+ lb = elm_label_add(scr);
+ elm_object_text_set(lb, "Enlightenment started out way back in 1996 as a project to build a Window Manager for X11. It has grown much more since then. Enlightenment still produces this Window Manager, but it has evolved to also cover Mobile, Wearable and TV UI requirements for projects such as Tizen as well as the traditional “desktop” UI. We still push out releases. See our download page for more details on the this. Visit our contribute page for our latest source code repositories. The project is currently transitioning from X11 to Wayland. We are fully committed to moving to Wayland eventually, as its the future of graphical display layers on Linux. We still primarily support Linux for Enlightenment, but there is some effort (based on help and support from users and some developers) to support BSD too.");
+ elm_table_pack(inner_table, lb, 1, 2, 1, 1);
+ evas_object_show(lb);
+
+ lb = elm_label_add(scr);
+ elm_object_text_set(lb, "Enlightenment started out way back in 1996 as a project to build a Window Manager for X11. It has grown much more since then. Enlightenment still produces this Window Manager, but it has evolved to also cover Mobile, Wearable and TV UI requirements for projects such as Tizen as well as the traditional “desktop” UI. We still push out releases. See our download page for more details on the this. Visit our contribute page for our latest source code repositories. The project is currently transitioning from X11 to Wayland. We are fully committed to moving to Wayland eventually, as its the future of graphical display layers on Linux. We still primarily support Linux for Enlightenment, but there is some effort (based on help and support from users and some developers) to support BSD too.");
+ elm_table_pack(inner_table, lb, 2, 1, 1, 1);
+ evas_object_show(lb);
+
+ btn = elm_button_add(table);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0.0);
+ elm_object_text_set(btn, "Button 2");
+ elm_table_pack(inner_table, btn, 1, 1, 1, 1);
+ evas_object_show(btn);
+
+ btn = elm_button_add(table);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0.0);
+ elm_object_text_set(btn, "Button 2");
+ elm_table_pack(table, btn, 0, 1, 2, 1);
+ evas_object_show(btn);
+
+ btn2 = elm_button_add(table);
+ evas_object_size_hint_weight_set(btn2, 0.0, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn2, 0.0, EVAS_HINT_FILL);
+ elm_object_text_set(btn2, "Button 3");
+ elm_table_pack(table, btn2, 1, 0, 1, 1);
+ evas_object_show(btn2);
+
+ evas_object_resize(win, 400, 550);
+ evas_object_show(win);
+}