aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-26 17:30:19 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-04 08:45:49 +0100
commit1ede2302d3bf6170fc7987d38056ce0e05001738 (patch)
tree3ba7509baebb1c2b6c3149f73855b3d2174e3430 /src
parentelm_interface_scrollable: add support for *jumping* into a scroller (diff)
downloadefl-1ede2302d3bf6170fc7987d38056ce0e05001738.tar.gz
efl_ui_focus_manager_root_focus: ensure that adapter is part of viewport
This ensures that the adapter part is part of the viewport elements and border elements. This is done in order to support cases where a elm_scroller content is not focusable. Before the element was not correctly in viewport, and so not correctly registered. ref https://phab.enlightenment.org/T6804 Differential Revision: https://phab.enlightenment.org/D7364
Diffstat (limited to 'src')
-rw-r--r--src/bin/elementary/test.c2
-rw-r--r--src/bin/elementary/test_scroller.c44
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.c9
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_root_focus.c4
4 files changed, 54 insertions, 5 deletions
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index 4d01d963db..f44052f216 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -179,6 +179,7 @@ void test_scroller2(void *data, Evas_Object *obj, void *event_info);
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_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);
@@ -1060,6 +1061,7 @@ add_tests:
ADD_TEST(NULL, "Scroller", "Scroller 3", test_scroller3);
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_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 a6670c6613..ef8ef7e49c 100644
--- a/src/bin/elementary/test_scroller.c
+++ b/src/bin/elementary/test_scroller.c
@@ -1017,3 +1017,47 @@ test_scroller5(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
evas_object_resize(win, 400, 550);
evas_object_show(win);
}
+
+void
+test_scroller6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Evas_Object *win, *scr, *lb, *table, *btn, *btn2;
+
+ 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);
+
+ 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_object_content_set(scr, lb);
+ 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(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);
+}
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c
index d6b5569cd1..b22832e41a 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -243,8 +243,11 @@ node_item_free(Node *item)
#define MAKE_LIST_DIRTY(node, field) \
EINA_LIST_FOREACH(DIRECTION_ACCESS(node, i).field, l, partner) \
{ \
- dirty_add(obj, pd, partner); \
- dirty_added = EINA_TRUE; \
+ if (partner->type != NODE_TYPE_ONLY_LOGICAL) \
+ { \
+ dirty_add(obj, pd, partner); \
+ dirty_added = EINA_TRUE; \
+ } \
}
MAKE_LIST_DIRTY(item, one_direction)
@@ -409,7 +412,7 @@ dirty_flush_node(Efl_Ui_Focus_Manager *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Cal
static void
dirty_flush(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Node *node)
{
- if (!pd->dirty) return;
+ if (!pd->dirty && node->type == NODE_TYPE_NORMAL) return;
efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL);
diff --git a/src/lib/elementary/efl_ui_focus_manager_root_focus.c b/src/lib/elementary/efl_ui_focus_manager_root_focus.c
index 0df8b5e862..82eb1fb697 100644
--- a/src/lib/elementary/efl_ui_focus_manager_root_focus.c
+++ b/src/lib/elementary/efl_ui_focus_manager_root_focus.c
@@ -180,7 +180,7 @@ _efl_ui_focus_manager_root_focus_canvas_object_set(Eo *obj, Efl_Ui_Focus_Manager
if (pd->replacement_object)
{
- pd->iterator_list = eina_list_remove(pd->iterator_list, pd->replacement_object);
+ pd->iterator_list = eina_list_remove(pd->iterator_list, pd->rect);
pd->replacement_object = NULL;
}
@@ -188,7 +188,7 @@ _efl_ui_focus_manager_root_focus_canvas_object_set(Eo *obj, Efl_Ui_Focus_Manager
if (pd->replacement_object)
{
efl_ui_focus_composition_adapter_canvas_object_set(pd->rect, pd->replacement_object);
- pd->iterator_list = eina_list_append(pd->iterator_list, pd->replacement_object);
+ pd->iterator_list = eina_list_append(pd->iterator_list, pd->rect);
}
}