Elm_Widget_Item *item, *above_gengrid = widget;
Efl_Ui_Widget *parent = elm_widget_parent_widget_get(widget);
+ if (parent == pd->container)
+ {
+ item = eina_hash_find(pd->map, &above_gengrid);
+ efl_ui_focus_object_prepare_logical(pd->container);
+
+ if (item)
+ return item;
+ }
+
+ // We dont have a map entry
+ return efl_ui_focus_parent_provider_find_logical_parent(pd->provider, widget);
+}
+
+EOLIAN static Efl_Ui_Widget*
+_efl_ui_focus_parent_provider_gen_item_fetch(Eo *obj, Efl_Ui_Focus_Parent_Provider_Gen_Data *pd, Efl_Ui_Widget *widget)
+{
+ //first check if this item is in the map
+ Elm_Widget_Item *item, *above_gengrid = widget;
+ Efl_Ui_Widget *parent = elm_widget_parent_widget_get(widget);
+
//move forward so we get the last widget above the gengrid level,
//this may be the widget out of the map
while (parent && parent != pd->container)
efl_ui_focus_object_prepare_logical(pd->container);
- if (item)
- return item;
-
- // We dont have a map entry
- return efl_ui_focus_parent_provider_find_logical_parent(pd->provider, widget);
+ return item;
}
-
#include "efl_ui_focus_parent_provider_gen.eo.c"
container : Efl.Ui.Widget; [[Container widget]]
}
}
+ item_fetch {
+ [[Fetch the item where the item is a subchild from]]
+ params {
+ widget : Efl.Ui.Widget;
+ }
+ return : Efl.Ui.Widget;
+ }
}
implements {
Efl.Ui.Focus.Parent_Provider.find_logical_parent;
if (!focused) return;
- if (efl_isa(focused, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS))
- item = efl_parent_get(focused);
- else
- item = efl_ui_focus_parent_provider_find_logical_parent(pd->provider, focused);
+ item = efl_ui_focus_parent_provider_gen_item_fetch(pd->provider, focused);
+
+ EINA_SAFETY_ON_FALSE_RETURN(efl_isa(item, ELM_GENGRID_ITEM_CLASS));
- if (efl_isa(item, ELM_GENGRID_ITEM_CLASS))
+ _elm_gengrid_item_focused(item);
+ _all_items_deselect(pd);
+ if (!_elm_config->item_select_on_focus_disable)
{
- _elm_gengrid_item_focused(item);
- _all_items_deselect(pd);
- if (!_elm_config->item_select_on_focus_disable)
- {
- elm_gengrid_item_selected_set(item, EINA_TRUE);
- elm_gengrid_item_bring_in(item, ELM_GENGRID_ITEM_SCROLLTO_MIDDLE);
- }
+ elm_gengrid_item_selected_set(item, EINA_TRUE);
+ elm_gengrid_item_bring_in(item, ELM_GENGRID_ITEM_SCROLLTO_MIDDLE);
}
}
if (!focused) return;
- if (efl_isa(focused, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS))
- item = efl_parent_get(focused);
- else
- item = efl_ui_focus_parent_provider_find_logical_parent(pd->provider, focused);
+ item = efl_ui_focus_parent_provider_gen_item_fetch(pd->provider, focused);
- if (efl_isa(item, ELM_GENLIST_ITEM_CLASS))
- {
- elm_object_item_focus_set(item, EINA_TRUE);
- }
+ EINA_SAFETY_ON_FALSE_RETURN(efl_isa(item, ELM_GENLIST_ITEM_CLASS));
+ elm_object_item_focus_set(item, EINA_TRUE);
}
EOLIAN static Eo *