forked from enlightenment/efl
elm_gengrid: rework focus registration
before just everything has been registered, now only the realized items are registered. ref T7384 Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D8366
This commit is contained in:
parent
834219013d
commit
f1678d06c2
|
@ -1265,6 +1265,11 @@ _elm_gengrid_item_unrealize(Elm_Gen_Item *it,
|
||||||
it->realized = EINA_FALSE;
|
it->realized = EINA_FALSE;
|
||||||
it->want_unrealize = EINA_FALSE;
|
it->want_unrealize = EINA_FALSE;
|
||||||
|
|
||||||
|
{
|
||||||
|
ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
|
||||||
|
efl_ui_focus_manager_calc_unregister(sd->obj, EO_OBJ(it));
|
||||||
|
}
|
||||||
|
|
||||||
evas_event_thaw(evas_object_evas_get(WIDGET(it)));
|
evas_event_thaw(evas_object_evas_get(WIDGET(it)));
|
||||||
evas_event_thaw_eval(evas_object_evas_get(WIDGET(it)));
|
evas_event_thaw_eval(evas_object_evas_get(WIDGET(it)));
|
||||||
}
|
}
|
||||||
|
@ -1593,6 +1598,11 @@ _item_realize(Elm_Gen_Item *it)
|
||||||
ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
|
ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
|
||||||
Elm_Object_Item *eo_it = EO_OBJ(it);
|
Elm_Object_Item *eo_it = EO_OBJ(it);
|
||||||
|
|
||||||
|
if (!it->realized)
|
||||||
|
{
|
||||||
|
efl_ui_focus_manager_calc_register_logical(sd->obj, EO_OBJ(it), sd->obj, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if ((it->realized) ||
|
if ((it->realized) ||
|
||||||
(it->generation < sd->generation))
|
(it->generation < sd->generation))
|
||||||
return;
|
return;
|
||||||
|
@ -4359,8 +4369,6 @@ _elm_gengrid_efl_object_constructor(Eo *obj, Elm_Gengrid_Data *sd)
|
||||||
efl_ui_focus_parent_provider_gen_container_set(efl_added, obj),
|
efl_ui_focus_parent_provider_gen_container_set(efl_added, obj),
|
||||||
efl_ui_focus_parent_provider_gen_content_item_map_set(efl_added, sd->content_item_map));
|
efl_ui_focus_parent_provider_gen_content_item_map_set(efl_added, sd->content_item_map));
|
||||||
|
|
||||||
efl_ui_focus_composition_logical_mode_set(obj, EINA_TRUE);
|
|
||||||
|
|
||||||
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
||||||
sd->obj = obj;
|
sd->obj = obj;
|
||||||
|
|
||||||
|
@ -5811,7 +5819,7 @@ _elm_gengrid_efl_object_provider_find(const Eo *obj, Elm_Gengrid_Data *pd, const
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_elm_gengrid_efl_ui_focus_composition_prepare(Eo *obj, Elm_Gengrid_Data *pd)
|
_elm_gengrid_efl_ui_focus_object_setup_order(Eo *obj, Elm_Gengrid_Data *pd)
|
||||||
{
|
{
|
||||||
Elm_Gen_Item *item;
|
Elm_Gen_Item *item;
|
||||||
Eina_List *order = NULL;
|
Eina_List *order = NULL;
|
||||||
|
@ -5822,11 +5830,13 @@ _elm_gengrid_efl_ui_focus_composition_prepare(Eo *obj, Elm_Gengrid_Data *pd)
|
||||||
continue;
|
continue;
|
||||||
if (item->group)
|
if (item->group)
|
||||||
continue;
|
continue;
|
||||||
|
if (item->realized)
|
||||||
|
continue;
|
||||||
|
|
||||||
order = eina_list_append(order, item->base->eo_obj);
|
order = eina_list_append(order, item->base->eo_obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
efl_ui_focus_composition_elements_set(obj, order);
|
efl_ui_focus_manager_calc_update_order(obj, obj, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_Bool
|
EOLIAN static Eina_Bool
|
||||||
|
|
|
@ -386,7 +386,7 @@ Eina_Bool _elm_gengrid_efl_access_selection_all_children_select(Eo *obj, Elm_Gen
|
||||||
Eina_Bool _elm_gengrid_efl_access_selection_access_selection_clear(Eo *obj, Elm_Gengrid_Data *pd);
|
Eina_Bool _elm_gengrid_efl_access_selection_access_selection_clear(Eo *obj, Elm_Gengrid_Data *pd);
|
||||||
|
|
||||||
|
|
||||||
void _elm_gengrid_efl_ui_focus_composition_prepare(Eo *obj, Elm_Gengrid_Data *pd);
|
void _elm_gengrid_efl_ui_focus_object_setup_order(Eo *obj, Elm_Gengrid_Data *pd);
|
||||||
|
|
||||||
|
|
||||||
Eina_Bool _elm_gengrid_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Gengrid_Data *pd, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect);
|
Eina_Bool _elm_gengrid_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Gengrid_Data *pd, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect);
|
||||||
|
@ -478,7 +478,7 @@ _elm_gengrid_class_initializer(Efl_Class *klass)
|
||||||
EFL_OBJECT_OP_FUNC(efl_access_selection_is_child_selected, _elm_gengrid_efl_access_selection_is_child_selected),
|
EFL_OBJECT_OP_FUNC(efl_access_selection_is_child_selected, _elm_gengrid_efl_access_selection_is_child_selected),
|
||||||
EFL_OBJECT_OP_FUNC(efl_access_selection_all_children_select, _elm_gengrid_efl_access_selection_all_children_select),
|
EFL_OBJECT_OP_FUNC(efl_access_selection_all_children_select, _elm_gengrid_efl_access_selection_all_children_select),
|
||||||
EFL_OBJECT_OP_FUNC(efl_access_selection_clear, _elm_gengrid_efl_access_selection_access_selection_clear),
|
EFL_OBJECT_OP_FUNC(efl_access_selection_clear, _elm_gengrid_efl_access_selection_access_selection_clear),
|
||||||
EFL_OBJECT_OP_FUNC(efl_ui_focus_composition_prepare, _elm_gengrid_efl_ui_focus_composition_prepare),
|
EFL_OBJECT_OP_FUNC(efl_ui_focus_object_setup_order, _elm_gengrid_efl_ui_focus_object_setup_order),
|
||||||
EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_state_apply, _elm_gengrid_efl_ui_widget_focus_state_apply),
|
EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_state_apply, _elm_gengrid_efl_ui_widget_focus_state_apply),
|
||||||
EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_setup_on_first_touch, _elm_gengrid_efl_ui_focus_manager_setup_on_first_touch),
|
EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_setup_on_first_touch, _elm_gengrid_efl_ui_focus_manager_setup_on_first_touch),
|
||||||
EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_focus_get, _elm_gengrid_efl_ui_focus_manager_manager_focus_get),
|
EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_focus_get, _elm_gengrid_efl_ui_focus_manager_manager_focus_get),
|
||||||
|
@ -512,6 +512,6 @@ static const Efl_Class_Description _elm_gengrid_class_desc = {
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
EFL_DEFINE_CLASS(elm_gengrid_class_get, &_elm_gengrid_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL);
|
EFL_DEFINE_CLASS(elm_gengrid_class_get, &_elm_gengrid_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL);
|
||||||
|
|
||||||
#include "elm_gengrid_eo.legacy.c"
|
#include "elm_gengrid_eo.legacy.c"
|
||||||
|
|
Loading…
Reference in New Issue