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))
+ 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 (GG_IT(it)->wsd->focused)
edje_object_signal_emit (VIEW(GG_IT(it)->wsd->focused), "elm,state,focused", "elm");
return EINA_TRUE;
}
-static void _gengrid_item_focused(Elm_Gen_Item *it)
+static void _gengrid_item_unfocused(Elm_Gen_Item *it)
{
if (!it) return;
Elm_Gengrid_Smart_Data *sd = GG_IT(it)->wsd;
- Evas_Coord x, y, w, h, sx, sy, sw, sh;
+ if (!sd->focused) return;
- evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
- evas_object_geometry_get(ELM_WIDGET_DATA(sd)->obj, &sx, &sy, &sw, &sh);
- if ((x < sx) || (y < sy) || ((x + w) > (sx + sw)) || ((y + h) > (sy + sh)))
+ if (sd->focused_content)
{
- elm_gengrid_item_bring_in((Elm_Object_Item *)it,
- ELM_GENLIST_ITEM_SCROLLTO_IN);
+ elm_object_focus_set(ELM_WIDGET_DATA(sd)->obj, EINA_FALSE);
+ elm_object_focus_set(ELM_WIDGET_DATA(sd)->obj, EINA_TRUE);
+ sd->focused_content = NULL;
}
edje_object_signal_emit
- (VIEW(it), "elm,state,focused", "elm");
+ (VIEW(sd->focused), "elm,state,unfocused", "elm");
- sd->focused = it;
+ if (it == sd->focused) sd->focused = NULL;
}
-static void _gengrid_item_unfocused(Elm_Gen_Item *it)
+static void _gengrid_item_focused(Elm_Gen_Item *it)
{
if (!it) return;
Elm_Gengrid_Smart_Data *sd = GG_IT(it)->wsd;
- if (!sd->focused) return;
+ Evas_Coord x, y, w, h, sx, sy, sw, sh;
- if (sd->focused_content)
+ if (sd->focused && (it != sd->focused)) _gengrid_item_unfocused(sd->focused);
+ evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
+ evas_object_geometry_get(ELM_WIDGET_DATA(sd)->obj, &sx, &sy, &sw, &sh);
+ if ((x < sx) || (y < sy) || ((x + w) > (sx + sw)) || ((y + h) > (sy + sh)))
{
- elm_object_focus_set(ELM_WIDGET_DATA(sd)->obj, EINA_FALSE);
- elm_object_focus_set(ELM_WIDGET_DATA(sd)->obj, EINA_TRUE);
- sd->focused_content = NULL;
+ elm_gengrid_item_bring_in((Elm_Object_Item *)it,
+ ELM_GENLIST_ITEM_SCROLLTO_IN);
}
- edje_object_signal_emit
- (VIEW(sd->focused), "elm,state,unfocused", "elm");
- if (it == sd->focused) sd->focused = NULL;
+ if (elm_win_focus_highlight_enabled_get
+ (elm_widget_top_get(ELM_WIDGET_DATA(sd)->obj)))
+ edje_object_signal_emit
+ (VIEW(it), "elm,state,focused", "elm");
+
+ sd->focused = it;
}
static Elm_Gen_Item *_gengrid_item_focusable_search(Elm_Gen_Item *it, int dir)
{
if (elm_win_focus_highlight_enabled_get(elm_widget_top_get(obj)))
{
- if (sd->last_selected_item)
- {
- _gengrid_item_focused((Elm_Gen_Item *)sd->last_selected_item);
- }
- else if (sd->focused)
- {
- edje_object_signal_emit
- (VIEW(sd->focused), "elm,state,focused", "elm");
- }
+ if (sd->focused)
+ _gengrid_item_focused(sd->focused);
else
_gengrid_item_focused_next(sd, FOCUS_DIR_DOWN);
}
if (it->generation < GG_IT(it)->wsd->generation) return;
+ if (it == GG_IT(it)->wsd->focused) _gengrid_item_unfocused(it);
if (it->realized)
{
if (elm_widget_item_disabled_get(it))
else if (GG_IT(it)->wsd->select_mode != ELM_OBJECT_SELECT_MODE_ALWAYS)
return;
+ _gengrid_item_focused(it);
+
evas_object_ref(obj);
it->walking++;
GG_IT(it)->wsd->walking++;
edje_object_message_signal_process(it->item->deco_it_view);
}
}
- if (elm_widget_focus_get(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj))
+
+ 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 (GL_IT(it)->wsd->focused)
edje_object_signal_emit (VIEW(GL_IT(it)->wsd->focused), "elm,state,focused", "elm");
}
+
edje_object_message_signal_process(VIEW(it));
}
Elm_Genlist_Smart_Data *sd = GL_IT(it)->wsd;
Evas_Coord x, y, w, h, sx, sy, sw, sh;
- if (sd->focused && (it == sd->focused)) _item_unfocused(sd->focused);
+ if (sd->focused && (it != sd->focused)) _item_unfocused(sd->focused);
evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
evas_object_geometry_get(ELM_WIDGET_DATA(sd)->obj, &sx, &sy, &sw, &sh);
if ((x < sx) || (y < sy) || ((x + w) > (sx + sw)) || ((y + h) > (sy + sh)))
ELM_GENLIST_ITEM_SCROLLTO_IN);
}
- if (it->deco_all_view)
- edje_object_signal_emit
- (it->deco_all_view, "elm,state,focused", "elm");
- else
- edje_object_signal_emit
- (VIEW(it), "elm,state,focused", "elm");
+ if (elm_win_focus_highlight_enabled_get
+ (elm_widget_top_get(ELM_WIDGET_DATA(sd)->obj)))
+ {
+ if (it->deco_all_view)
+ edje_object_signal_emit
+ (it->deco_all_view, "elm,state,focused", "elm");
+ else
+ edje_object_signal_emit
+ (VIEW(it), "elm,state,focused", "elm");
+ }
sd->focused = it;
}
it->selected = EINA_TRUE;
sd->selected = eina_list_append(sd->selected, it);
sd->last_selected_item = (Elm_Object_Item *)it;
- if (sd->focused) _item_unfocused(sd->focused);
_item_focused(it);
if (it->func.func) it->func.func((void *)it->func.data, obj, it);
sd->last_selected_item = eina_list_data_get(sd->selected);
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 (sd->focused)
- {
- _item_focused(sd->focused);
- }
+ _item_focused(sd->focused);
else
- {
- _item_focused_next(sd, FOCUS_DIR_DOWN);
- }
+ _item_focused_next(sd, FOCUS_DIR_DOWN);
}
}
else
elm_list_item_bring_in((Elm_Object_Item *)it);
}
- edje_object_signal_emit
- (VIEW(it), "elm,state,focused", "elm");
+ if (elm_win_focus_highlight_enabled_get
+ (elm_widget_top_get(ELM_WIDGET_DATA(sd)->obj)))
+ edje_object_signal_emit
+ (VIEW(it), "elm,state,focused", "elm");
sd->focused = (Elm_Object_Item *)it;
}
{
if (elm_win_focus_highlight_enabled_get(elm_widget_top_get(obj)))
{
- if (sd->last_selected_item)
- {
- _item_focused((Elm_List_Item *)sd->last_selected_item);
- }
- else if (sd->focused)
- {
- edje_object_signal_emit
- (VIEW(sd->focused), "elm,state,focused", "elm");
- }
+ if (sd->focused)
+ _item_focused((Elm_List_Item *)sd->focused);
else
- _item_focused_next(sd, FOCUS_DIR_DOWN);
+ _item_focused_next(sd, FOCUS_DIR_DOWN);
}
}
else