forked from enlightenment/efl
elm_widget_item: refactor logic from gengrid into seperated class
This commit is contained in:
parent
c075b7caaa
commit
53052abaa6
|
@ -148,6 +148,7 @@ elm_legacy_eolian_files = \
|
|||
lib/elementary/elm_menu_item.eo \
|
||||
lib/elementary/elm_ctxpopup_item.eo \
|
||||
lib/elementary/elm_index_item.eo \
|
||||
lib/elementary/elm_widget_item_static_focus.eo \
|
||||
lib/elementary/elm_genlist_item.eo \
|
||||
lib/elementary/elm_gengrid_item.eo \
|
||||
lib/elementary/elm_list_item.eo \
|
||||
|
@ -700,6 +701,7 @@ lib_elementary_libelementary_la_SOURCES = \
|
|||
lib/elementary/efl_ui_focus_parent_provider.c \
|
||||
lib/elementary/efl_ui_focus_parent_provider_standard.c \
|
||||
lib/elementary/efl_ui_focus_parent_provider_gen.c \
|
||||
lib/elementary/elm_widget_item_static_focus.c \
|
||||
$(NULL)
|
||||
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ enum Elm.Gengrid.Item.Field_Type
|
|||
}
|
||||
|
||||
|
||||
class Elm.Gengrid.Item(Elm.Widget.Item, Efl.Ui.Focus.Object)
|
||||
class Elm.Gengrid.Item(Elm.Widget.Item.Static_Focus, Efl.Ui.Focus.Object)
|
||||
{
|
||||
[[Elementary gengrid item class]]
|
||||
legacy_prefix: elm_gengrid_item;
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#include "elm_code_private.h"
|
||||
#include "efl_ui_focus_parent_provider.eo.h"
|
||||
#include "efl_ui_focus_parent_provider_standard.eo.h"
|
||||
#include "elm_widget_item_static_focus.eo.h"
|
||||
|
||||
#ifdef HAVE_LANGINFO_H
|
||||
# include <langinfo.h>
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include "elementary_config.h"
|
||||
#endif
|
||||
|
||||
#define ELM_WIDGET_ITEM_PROTECTED
|
||||
|
||||
#include <Elementary.h>
|
||||
#include "elm_priv.h"
|
||||
#include "efl_ui_focus_composition_adapter.eo.h"
|
||||
|
||||
typedef struct {
|
||||
Eo *adapter;
|
||||
} Elm_Widget_Item_Static_Focus_Data;
|
||||
|
||||
EOLIAN static void
|
||||
_elm_widget_item_static_focus_efl_ui_focus_object_prepare_logical(Eo *obj, Elm_Widget_Item_Static_Focus_Data *pd EINA_UNUSED)
|
||||
{
|
||||
Elm_Widget_Item_Data *wpd = efl_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
|
||||
|
||||
efl_ui_focus_object_prepare_logical(efl_super(obj, ELM_WIDGET_ITEM_STATIC_FOCUS_CLASS));
|
||||
|
||||
if (!efl_ui_focus_manager_request_subchild(wpd->widget, obj))
|
||||
{
|
||||
if (!pd->adapter)
|
||||
{
|
||||
pd->adapter = efl_add(EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS, obj, efl_ui_focus_composition_adapter_canvas_object_set(efl_added, wpd->view));
|
||||
efl_wref_add(pd->adapter, &pd->adapter);
|
||||
efl_ui_focus_manager_calc_register(wpd->widget, pd->adapter, obj, NULL);
|
||||
}
|
||||
}
|
||||
else if (pd->adapter)
|
||||
{
|
||||
efl_ui_focus_manager_calc_unregister(wpd->widget, pd->adapter);
|
||||
efl_del(pd->adapter);
|
||||
pd->adapter = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#include "elm_widget_item_static_focus.eo.c"
|
|
@ -0,0 +1,7 @@
|
|||
class Elm.Widget.Item.Static_Focus (Elm.Widget.Item, Efl.Ui.Focus.Object)
|
||||
{
|
||||
[[A class that ensures that at least ONE focusable target is behind this widget item. If there is none registered to it after a prepare call it will register the view of the item as item.]]
|
||||
implements {
|
||||
Efl.Ui.Focus.Object.prepare_logical;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue