summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2017-10-19 14:15:08 +0200
committerMarcel Hollerbach <marcel@osg.samsung.com>2017-10-19 15:20:59 +0200
commit0c3bec93a1ee64ff26ea1acbc0fc6ae36e625157 (patch)
treef5cecac6b5976dca7329604013cd8acee86b6773 /src/lib/elementary
parent8d20422e8bf9a8fcee7ba67f288b524d0fd04c82 (diff)
elm_gengrid: bring in item once focused
and select & focus the item where the widget is in
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/elm_gengrid.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c
index b76b5e28b2..a2cdc83c30 100644
--- a/src/lib/elementary/elm_gengrid.c
+++ b/src/lib/elementary/elm_gengrid.c
@@ -4230,6 +4230,20 @@ elm_gengrid_add(Evas_Object *parent)
4230 return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added)); 4230 return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
4231} 4231}
4232 4232
4233static void
4234_gengrid_element_focused(void *data, const Efl_Event *ev)
4235{
4236 ELM_GENGRID_DATA_GET(data, pd);
4237 Elm_Widget_Item *item = efl_ui_focus_parent_provider_find_logical_parent(pd->provider, ev->info);
4238 if (efl_isa(item, ELM_GENGRID_ITEM_CLASS))
4239 {
4240 _elm_gengrid_item_focused(item);
4241 _all_items_deselect(pd);
4242 elm_gengrid_item_selected_set(item, EINA_TRUE);
4243 elm_gengrid_item_bring_in(item, ELM_GENGRID_ITEM_SCROLLTO_MIDDLE);
4244 }
4245}
4246
4233EOLIAN static Eo * 4247EOLIAN static Eo *
4234_elm_gengrid_efl_object_constructor(Eo *obj, Elm_Gengrid_Data *sd) 4248_elm_gengrid_efl_object_constructor(Eo *obj, Elm_Gengrid_Data *sd)
4235{ 4249{
@@ -4248,6 +4262,8 @@ _elm_gengrid_efl_object_constructor(Eo *obj, Elm_Gengrid_Data *sd)
4248 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); 4262 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
4249 efl_access_role_set(obj, EFL_ACCESS_ROLE_TREE_TABLE); 4263 efl_access_role_set(obj, EFL_ACCESS_ROLE_TREE_TABLE);
4250 4264
4265 efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, _gengrid_element_focused, obj);
4266
4251 return obj; 4267 return obj;
4252} 4268}
4253 4269