_elm_access_activate_callback_set(ai, _access_activate_cb, it);
}
+// FIXME: There are applications which do not use elm_win as top widget.
+// This is workaround! Those could not use focus!
+static Eina_Bool _focus_enabled(Evas_Object *obj)
+{
+ if (!elm_widget_focus_get(obj)) return EINA_FALSE;
+
+ const Evas_Object *win = elm_widget_top_get(obj);
+ const char *type = evas_object_type_get(win);
+
+ if (type && !strcmp(type, "elm_win"))
+ {
+ return elm_win_focus_highlight_enabled_get(win);
+ }
+ return EINA_FALSE;
+}
+
static void
_item_realize(Elm_Gen_Item *it)
{
if (it->selected)
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
- if (elm_widget_focus_get(ELM_WIDGET_DATA(GG_IT(it)->wsd)->obj) &&
- elm_win_focus_highlight_enabled_get
- (elm_widget_top_get(ELM_WIDGET_DATA(GG_IT(it)->wsd)->obj)))
+ if (_focus_enabled(ELM_WIDGET_DATA(GG_IT(it)->wsd)->obj))
{
if (GG_IT(it)->wsd->focused)
edje_object_signal_emit (VIEW(GG_IT(it)->wsd->focused), "elm,state,focused", "elm");
ELM_GENLIST_ITEM_SCROLLTO_IN);
}
- if (elm_win_focus_highlight_enabled_get
- (elm_widget_top_get(ELM_WIDGET_DATA(sd)->obj)))
+ if (_focus_enabled(ELM_WIDGET_DATA(sd)->obj))
edje_object_signal_emit
(VIEW(it), "elm,state,focused", "elm");
if (elm_widget_focus_get(obj))
{
- if (elm_win_focus_highlight_enabled_get(elm_widget_top_get(obj)))
+ if (_focus_enabled(obj))
{
if (sd->focused)
_gengrid_item_focused(sd->focused);
it->item->mincalcd = EINA_TRUE;
}
+// FIXME: There are applications which do not use elm_win as top widget.
+// This is workaround! Those could not use focus!
+static Eina_Bool _focus_enabled(Evas_Object *obj)
+{
+ if (!elm_widget_focus_get(obj)) return EINA_FALSE;
+
+ const Evas_Object *win = elm_widget_top_get(obj);
+ const char *type = evas_object_type_get(win);
+
+ if (type && !strcmp(type, "elm_win"))
+ {
+ return elm_win_focus_highlight_enabled_get(win);
+ }
+ return EINA_FALSE;
+}
+
static void
_item_realize(Elm_Gen_Item *it,
int in,
}
}
- if (elm_widget_focus_get(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj) &&
- elm_win_focus_highlight_enabled_get
- (elm_widget_top_get(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj)))
+ if (_focus_enabled(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj))
{
if (GL_IT(it)->wsd->focused)
edje_object_signal_emit (VIEW(GL_IT(it)->wsd->focused), "elm,state,focused", "elm");
ELM_GENLIST_ITEM_SCROLLTO_IN);
}
- if (elm_win_focus_highlight_enabled_get
- (elm_widget_top_get(ELM_WIDGET_DATA(sd)->obj)))
+ if (_focus_enabled(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj))
{
if (it->deco_all_view)
edje_object_signal_emit
if (sd->select_on_focus_enabled) return EINA_TRUE;
if (elm_widget_focus_get(obj))
{
- if (elm_win_focus_highlight_enabled_get(elm_widget_top_get(obj)))
+ if (_focus_enabled(obj))
{
if (sd->focused)
_item_focused(sd->focused);
return EINA_TRUE;
}
+// FIXME: There are applications which do not use elm_win as top widget.
+// This is workaround! Those could not use focus!
+static Eina_Bool _focus_enabled(Evas_Object *obj)
+{
+ if (!elm_widget_focus_get(obj)) return EINA_FALSE;
+
+ const Evas_Object *win = elm_widget_top_get(obj);
+ const char *type = evas_object_type_get(win);
+
+ if (type && !strcmp(type, "elm_win"))
+ {
+ return elm_win_focus_highlight_enabled_get(win);
+ }
+ return EINA_FALSE;
+}
+
static void _item_focused(Elm_List_Item *it)
{
if (!it) return;
elm_list_item_bring_in((Elm_Object_Item *)it);
}
- if (elm_win_focus_highlight_enabled_get
- (elm_widget_top_get(ELM_WIDGET_DATA(sd)->obj)))
+ if (_focus_enabled(ELM_WIDGET_DATA(sd)->obj))
edje_object_signal_emit
(VIEW(it), "elm,state,focused", "elm");
if (sd->select_on_focus_enabled) return EINA_TRUE;
if (elm_widget_focus_get(obj))
{
- if (elm_win_focus_highlight_enabled_get(elm_widget_top_get(obj)))
+ if (_focus_enabled(obj))
{
if (sd->focused)
_item_focused((Elm_List_Item *)sd->focused);