diff options
author | Marcel Hollerbach <marcel@osg.samsung.com> | 2017-10-17 20:06:28 +0200 |
---|---|---|
committer | Marcel Hollerbach <marcel@osg.samsung.com> | 2017-10-19 10:04:59 +0200 |
commit | 67234dcde14291fdd0a357b30ed0e063d77bc552 (patch) | |
tree | 2bb80fbfba3f5f379eae825eb1108cb6d538f24c /src/lib/elementary | |
parent | 6956dfc7a6a0f85ff485d2e18c5c3439ad461f37 (diff) |
efl_ui_focus_manager_calc: reimplement move to be more compact & small
this fixes a bug when a redirect was unset while going the prev
direction.
Diffstat (limited to 'src/lib/elementary')
-rw-r--r-- | src/lib/elementary/efl_ui_focus_manager_calc.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c index 7cc75a643a..033db69486 100644 --- a/src/lib/elementary/efl_ui_focus_manager_calc.c +++ b/src/lib/elementary/efl_ui_focus_manager_calc.c | |||
@@ -1405,31 +1405,26 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_move(Eo *obj EINA_UNUSED, Efl_Ui | |||
1405 | { | 1405 | { |
1406 | Efl_Ui_Focus_Object *old_candidate = NULL; | 1406 | Efl_Ui_Focus_Object *old_candidate = NULL; |
1407 | candidate = efl_ui_focus_manager_move(pd->redirect, direction); | 1407 | candidate = efl_ui_focus_manager_move(pd->redirect, direction); |
1408 | old_candidate = efl_ui_focus_manager_focus_get(pd->redirect); | ||
1409 | 1408 | ||
1410 | if (!candidate) | 1409 | if (!candidate) |
1411 | { | 1410 | { |
1412 | Efl_Ui_Focus_Object *new_candidate = NULL; | 1411 | Efl_Ui_Focus_Object *new_candidate = NULL; |
1413 | Node *n; | ||
1414 | 1412 | ||
1415 | //there is no candidate check if we have something for that direction | 1413 | if (DIRECTION_IS_LOGICAL(direction)) |
1416 | new_candidate = NULL; | ||
1417 | n = eina_hash_find(pd->node_hash, &old_candidate); | ||
1418 | |||
1419 | if (direction == EFL_UI_FOCUS_DIRECTION_NEXT || | ||
1420 | direction == EFL_UI_FOCUS_DIRECTION_PREVIOUS) | ||
1421 | { | 1414 | { |
1422 | if (n) | 1415 | // lets just take the last |
1423 | { | 1416 | Node *n = eina_list_last_data_get(pd->focus_stack); |
1424 | n = T(n).parent; | 1417 | new_candidate = _request_move(obj, pd, direction, n); |
1425 | new_candidate = _request_move(obj, pd, direction, n); | 1418 | if (new_candidate) |
1426 | if (new_candidate) | 1419 | efl_ui_focus_manager_focus_set(obj, new_candidate); |
1427 | efl_ui_focus_manager_focus_set(obj, new_candidate); | 1420 | candidate = new_candidate; |
1428 | candidate = new_candidate; | ||
1429 | } | ||
1430 | } | 1421 | } |
1431 | else | 1422 | else |
1432 | { | 1423 | { |
1424 | Node *n; | ||
1425 | |||
1426 | old_candidate = efl_ui_focus_manager_focus_get(pd->redirect); | ||
1427 | n = eina_hash_find(pd->node_hash, &old_candidate); | ||
1433 | 1428 | ||
1434 | if (n) | 1429 | if (n) |
1435 | new_candidate = _request_move(obj, pd, direction, n); | 1430 | new_candidate = _request_move(obj, pd, direction, n); |
@@ -1439,9 +1434,9 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_move(Eo *obj EINA_UNUSED, Efl_Ui | |||
1439 | //redirect does not have smth. but we do have. | 1434 | //redirect does not have smth. but we do have. |
1440 | efl_ui_focus_manager_focus_set(obj, new_candidate); | 1435 | efl_ui_focus_manager_focus_set(obj, new_candidate); |
1441 | } | 1436 | } |
1442 | candidate = new_candidate; | ||
1443 | } | ||
1444 | 1437 | ||
1438 | candidate = new_candidate; | ||
1439 | } | ||
1445 | } | 1440 | } |
1446 | } | 1441 | } |
1447 | else | 1442 | else |