summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-12 12:49:19 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-17 09:12:22 +0100
commite779492a1c029203d703ad31d4d647a45a5034dc (patch)
tree271474c2b2d55ba37d037f65a2ba157dbdcf0fb0 /src
parent6922761f3fd0351403e0c2c6d10d1fd0c4fe9bdd (diff)
elm_genlist: behaviour fixes for genlist
This implements the behaviour in case no item is yet focused, but the genlist is focused. ref T6805 Reviewed-by: YeongJong Lee <yj34.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D7452
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/elm_genlist.c43
-rw-r--r--src/lib/elementary/elm_genlist.eo1
2 files changed, 44 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 728d33376b..0ad79d137a 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -3455,6 +3455,49 @@ _elm_genlist_efl_ui_focus_manager_manager_focus_get(const Eo *obj, Elm_Genlist_D
3455 return focused_obj; 3455 return focused_obj;
3456} 3456}
3457 3457
3458static Efl_Ui_Focus_Object*
3459_select_candidate(Eo *obj, Elm_Genlist_Data *pd, Efl_Ui_Focus_Direction direction)
3460{
3461 Elm_Object_Item *first = elm_genlist_first_item_get(obj);
3462 Elm_Object_Item *last = elm_genlist_last_item_get(obj);
3463
3464 switch(direction)
3465 {
3466 case EFL_UI_FOCUS_DIRECTION_DOWN:
3467 case EFL_UI_FOCUS_DIRECTION_RIGHT:
3468 elm_object_item_focus_set(first, EINA_TRUE);
3469 return obj;
3470 break;
3471 case EFL_UI_FOCUS_DIRECTION_UP:
3472 case EFL_UI_FOCUS_DIRECTION_LEFT:
3473 elm_object_item_focus_set(last, EINA_TRUE);
3474 return obj;
3475 break;
3476 case EFL_UI_FOCUS_DIRECTION_NEXT:
3477 case EFL_UI_FOCUS_DIRECTION_PREVIOUS:
3478 //do not go further with logical movement
3479 return NULL;
3480 break;
3481 default:
3482 ERR("Uncaught focus direction");
3483 return NULL;
3484 break;
3485 }
3486}
3487
3488EOLIAN static Efl_Ui_Focus_Object*
3489_elm_genlist_efl_ui_focus_manager_move(Eo *obj, Elm_Genlist_Data *pd, Efl_Ui_Focus_Direction direction)
3490{
3491 if (efl_ui_focus_manager_focus_get(obj) == obj)
3492 {
3493 return _select_candidate(obj, pd, direction);
3494 }
3495 else
3496 {
3497 return efl_ui_focus_manager_move(efl_super(obj, MY_CLASS), direction);
3498 }
3499}
3500
3458EOLIAN static Eina_Bool 3501EOLIAN static Eina_Bool
3459_elm_genlist_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Genlist_Data *sd) 3502_elm_genlist_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Genlist_Data *sd)
3460{ 3503{
diff --git a/src/lib/elementary/elm_genlist.eo b/src/lib/elementary/elm_genlist.eo
index 1d7e562616..9747b4765f 100644
--- a/src/lib/elementary/elm_genlist.eo
+++ b/src/lib/elementary/elm_genlist.eo
@@ -556,6 +556,7 @@ class Elm.Genlist (Efl.Ui.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
556 Efl.Ui.Widget.focus_state_apply; 556 Efl.Ui.Widget.focus_state_apply;
557 Efl.Ui.Focus.Manager.setup_on_first_touch; 557 Efl.Ui.Focus.Manager.setup_on_first_touch;
558 Efl.Ui.Focus.Manager.manager_focus { get; } 558 Efl.Ui.Focus.Manager.manager_focus { get; }
559 Efl.Ui.Focus.Manager.move;
559 } 560 }
560 events { 561 events {
561 item,focused: Efl.Object; [[Called when genlist item got focus]] 562 item,focused: Efl.Object; [[Called when genlist item got focus]]