forked from enlightenment/efl
efl_ui_focus_parent_provider_gen: provide results for adapters
Summary: a adapter is used whenno real widget is created during realization, when a adapter is used, the parent cannot be fetched via elm_widget_parent_get, there we need efl_parent_get Reviewers: ManMower, devilhorns, stephenmhouston, zmike, Hermet Reviewed By: Hermet Subscribers: Hermet, cedric, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6339
This commit is contained in:
parent
27c677f1e0
commit
add0611acc
|
@ -5,6 +5,7 @@
|
||||||
#include <Elementary.h>
|
#include <Elementary.h>
|
||||||
#include "elm_priv.h"
|
#include "elm_priv.h"
|
||||||
#include "efl_ui_focus_parent_provider_gen.eo.h"
|
#include "efl_ui_focus_parent_provider_gen.eo.h"
|
||||||
|
#include "efl_ui_focus_composition_adapter.eo.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Eina_Hash *map;
|
Eina_Hash *map;
|
||||||
|
@ -50,16 +51,28 @@ _efl_ui_focus_parent_provider_gen_efl_ui_focus_parent_provider_find_logical_pare
|
||||||
{
|
{
|
||||||
//first check if this item is in the map
|
//first check if this item is in the map
|
||||||
Elm_Widget_Item *item, *above_gengrid = widget;
|
Elm_Widget_Item *item, *above_gengrid = widget;
|
||||||
Efl_Ui_Widget *parent = elm_widget_parent_widget_get(widget);
|
Efl_Ui_Widget *parent;
|
||||||
|
|
||||||
if (parent == pd->container)
|
if (efl_isa(widget, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS))
|
||||||
{
|
{
|
||||||
item = eina_hash_find(pd->map, &above_gengrid);
|
item = efl_parent_get(widget);
|
||||||
efl_ui_focus_object_prepare_logical(pd->container);
|
|
||||||
|
|
||||||
if (item)
|
if (efl_isa(item, ELM_WIDGET_ITEM_CLASS))
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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
|
// We dont have a map entry
|
||||||
return efl_ui_focus_parent_provider_find_logical_parent(pd->provider, widget);
|
return efl_ui_focus_parent_provider_find_logical_parent(pd->provider, widget);
|
||||||
|
@ -70,7 +83,27 @@ _efl_ui_focus_parent_provider_gen_item_fetch(Eo *obj EINA_UNUSED, Efl_Ui_Focus_P
|
||||||
{
|
{
|
||||||
//first check if this item is in the map
|
//first check if this item is in the map
|
||||||
Elm_Widget_Item *item, *above_gengrid = widget;
|
Elm_Widget_Item *item, *above_gengrid = widget;
|
||||||
Efl_Ui_Widget *parent = elm_widget_parent_widget_get(widget);
|
Efl_Ui_Widget *parent;
|
||||||
|
|
||||||
|
if (efl_isa(widget, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS))
|
||||||
|
{
|
||||||
|
item = efl_parent_get(widget);
|
||||||
|
|
||||||
|
if (efl_isa(item, ELM_WIDGET_ITEM_CLASS))
|
||||||
|
{
|
||||||
|
efl_ui_focus_object_prepare_logical(pd->container);
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
parent = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
parent = elm_widget_parent_widget_get(widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//move forward so we get the last widget above the gengrid level,
|
//move forward so we get the last widget above the gengrid level,
|
||||||
//this may be the widget out of the map
|
//this may be the widget out of the map
|
||||||
|
@ -79,7 +112,6 @@ _efl_ui_focus_parent_provider_gen_item_fetch(Eo *obj EINA_UNUSED, Efl_Ui_Focus_P
|
||||||
above_gengrid = parent;
|
above_gengrid = parent;
|
||||||
parent = elm_widget_parent_widget_get(above_gengrid);
|
parent = elm_widget_parent_widget_get(above_gengrid);
|
||||||
}
|
}
|
||||||
|
|
||||||
item = eina_hash_find(pd->map, &above_gengrid);
|
item = eina_hash_find(pd->map, &above_gengrid);
|
||||||
|
|
||||||
efl_ui_focus_object_prepare_logical(pd->container);
|
efl_ui_focus_object_prepare_logical(pd->container);
|
||||||
|
|
Loading…
Reference in New Issue