forked from enlightenment/efl
efl_ui_focus_manager: a logical item should never get focus.
This commit is contained in:
parent
a5868fc819
commit
f6aefb2d88
|
@ -931,10 +931,20 @@ _prev(Node *node)
|
||||||
static Node*
|
static Node*
|
||||||
_logical_movement(Efl_Ui_Focus_Manager_Data *pd EINA_UNUSED, Node *upper, Efl_Ui_Focus_Direction direction)
|
_logical_movement(Efl_Ui_Focus_Manager_Data *pd EINA_UNUSED, Node *upper, Efl_Ui_Focus_Direction direction)
|
||||||
{
|
{
|
||||||
|
Node* (*deliver)(Node *n);
|
||||||
|
Node *result;
|
||||||
if (direction == EFL_UI_FOCUS_DIRECTION_NEXT)
|
if (direction == EFL_UI_FOCUS_DIRECTION_NEXT)
|
||||||
return _next(upper);
|
deliver = _next;
|
||||||
else
|
else
|
||||||
return _prev(upper);
|
deliver = _prev;
|
||||||
|
|
||||||
|
//search as long as we have a none logical parent
|
||||||
|
result = upper;
|
||||||
|
do {
|
||||||
|
result = deliver(result);
|
||||||
|
} while(result && result->type == NODE_TYPE_ONLY_LOGICAL);
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Efl_Ui_Focus_Object*
|
EOLIAN static Efl_Ui_Focus_Object*
|
||||||
|
|
|
@ -59,7 +59,7 @@ class Efl.Ui.Focus.Manager (Efl.Object) {
|
||||||
register_logical {
|
register_logical {
|
||||||
[[Register a new item just for the logical parent.
|
[[Register a new item just for the logical parent.
|
||||||
|
|
||||||
This item can just be used as a parent for a child. It cannot be reached via coordinate wise movements.
|
The item can never get focus, it just help to build a tree out of the items who are getting focus.
|
||||||
]]
|
]]
|
||||||
params {
|
params {
|
||||||
child : Efl.Ui.Focus.Object @nonull;
|
child : Efl.Ui.Focus.Object @nonull;
|
||||||
|
|
|
@ -197,7 +197,7 @@ START_TEST(logical_chain)
|
||||||
//register everything
|
//register everything
|
||||||
efl_ui_focus_manager_register(m, child1, root, NULL);
|
efl_ui_focus_manager_register(m, child1, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, child2, root, NULL);
|
efl_ui_focus_manager_register(m, child2, root, NULL);
|
||||||
efl_ui_focus_manager_register(m, child3, root, NULL);
|
efl_ui_focus_manager_register_logical(m, child3, root);
|
||||||
efl_ui_focus_manager_register(m, subchild11, child1, NULL);
|
efl_ui_focus_manager_register(m, subchild11, child1, NULL);
|
||||||
efl_ui_focus_manager_register(m, subchild12, child1, NULL);
|
efl_ui_focus_manager_register(m, subchild12, child1, NULL);
|
||||||
efl_ui_focus_manager_register(m, subchild13, child1, NULL);
|
efl_ui_focus_manager_register(m, subchild13, child1, NULL);
|
||||||
|
@ -207,7 +207,7 @@ START_TEST(logical_chain)
|
||||||
|
|
||||||
Efl_Object *logical_chain[] = {
|
Efl_Object *logical_chain[] = {
|
||||||
child1, subchild11, subchild12, subchild13,
|
child1, subchild11, subchild12, subchild13,
|
||||||
child2, child3, subchild21, subchild22, subchild23, root, NULL
|
child2, subchild21, subchild22, subchild23, root, NULL
|
||||||
};
|
};
|
||||||
for (i = 0; logical_chain[i]; ++i)
|
for (i = 0; logical_chain[i]; ++i)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue