diff options
author | YeongJong Lee <yj34.lee@samsung.com> | 2018-04-15 11:08:14 +0200 |
---|---|---|
committer | Marcel Hollerbach <marcel@osg.samsung.com> | 2018-04-15 11:52:34 +0200 |
commit | ffbbf7b7d69458f018f4e75f4842808255017e62 (patch) | |
tree | 0b525b36a3e20562f678c6df82d403b43a040c91 | |
parent | f0a0da9f449b0878fe6a5ce2abc50b8b6589c50a (diff) | |
download | efl-ffbbf7b7d69458f018f4e75f4842808255017e62.tar.gz |
elm_list: check there is focused item when list get focus at first
Summary:
list have got focus. but there isn't logic to check whether focused_item exist.
we need that logic for list focus
this fixes T6807, T6799
Test Plan: elementary_test -to 'list focus'
Reviewers: bu5hm4n
Reviewed By: bu5hm4n
Subscribers: cedric
Maniphest Tasks: T6807, T6799
Differential Revision: https://phab.enlightenment.org/D5935
-rw-r--r-- | src/lib/elementary/elm_list.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/lib/elementary/elm_list.c b/src/lib/elementary/elm_list.c index 4ad9e2405e..863497be70 100644 --- a/src/lib/elementary/elm_list.c +++ b/src/lib/elementary/elm_list.c @@ -376,6 +376,22 @@ _elm_list_efl_ui_widget_event_direction(Evas_Object *obj, Elm_Focus_Direction di (!sd->h_mode && (dir != ELM_FOCUS_UP) && (dir != ELM_FOCUS_DOWN))) return EINA_FALSE; + // check if list get focus at first + focus_only = _elm_config->item_select_on_focus_disable; + if (!sd->focused_item) + { + if ((dir == ELM_FOCUS_LEFT) || (dir == ELM_FOCUS_UP)) + eo_it = elm_list_last_item_get(obj); + else + eo_it = elm_list_first_item_get(obj); + + if (focus_only) + elm_object_item_focus_set(eo_it, EINA_TRUE); + else + elm_list_item_selected_set(eo_it, EINA_TRUE); + return EINA_TRUE; + } + // get content size and viewport size if ((dir == ELM_FOCUS_LEFT) || (dir == ELM_FOCUS_RIGHT)) { @@ -391,7 +407,6 @@ _elm_list_efl_ui_widget_event_direction(Evas_Object *obj, Elm_Focus_Direction di } // move focus or selection according to the configuration - focus_only = _elm_config->item_select_on_focus_disable; if (focus_only) ret = _item_focused_next(obj, dir); else @@ -3073,7 +3088,7 @@ _elm_list_item_coordinates_adjust(Elm_List_Item_Data *it) } EOLIAN static Eina_Rect -_elm_list_efl_ui_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_List_Data *sd) +_elm_list_efl_ui_widget_focus_highlight_geometry_get(Eo *obj, Elm_List_Data *sd) { Eina_Rect r = {}; @@ -3083,6 +3098,10 @@ _elm_list_efl_ui_widget_focus_highlight_geometry_get(Eo *obj EINA_UNUSED, Elm_Li r = _elm_list_item_coordinates_adjust(focus_it); elm_widget_focus_highlight_focus_part_geometry_get(VIEW(focus_it), &r.x, &r.y, &r.w, &r.h); } + else + { + r = efl_gfx_geometry_get(obj); + } return r; } |