static void _on_focus_hook(void *data, Evas_Object *obj);
static Eina_Bool _empty_entry(Evas_Object *entry);
+static const char SIG_FOCUSED[] = "focused";
+
+static const Evas_Smart_Cb_Description _signals[] = {
+ {SIG_FOCUSED, ""},
+ {NULL, NULL}
+};
+
static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd || !wd->base)
return;
- if (!elm_widget_focus_get(obj) && !(elm_widget_disabled_get(obj)) )
+ if (!elm_widget_focus_get(obj))
{
evas_object_smart_callback_call(obj, "unfocused", NULL);
wd->editing = EINA_FALSE;
}
}
}
+ else
+ {
+ evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
+ }
}
static void
evas_object_smart_callback_add(wd->entry, "changed", _entry_changed_cb, obj);
elm_widget_sub_object_add(obj, wd->entry);
evas_object_show(wd->entry);
+ evas_object_smart_callbacks_descriptions_set(obj, _signals);
_sizing_eval(obj);
return obj;
Eina_Bool updateme : 1;
Eina_Bool nocache : 1;
Eina_Bool move_effect_enabled : 1;
+ Eina_Bool defer_unrealize : 1;
// TODO: refactoring
Eina_Bool effect_done : 1;
}
static void
+_icon_focused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Elm_Genlist_Item *it = data;
+ if (it) it->defer_unrealize = EINA_TRUE;
+}
+
+static void
+_icon_unfocused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+ Elm_Genlist_Item *it = data;
+ if (it) it->defer_unrealize = EINA_FALSE;
+}
+
+static void
_item_realize(Elm_Genlist_Item *it,
int in,
Eina_Bool calc)
edje_object_part_swallow(it->base.view, key, ic);
evas_object_show(ic);
elm_widget_sub_object_add(it->base.widget, ic);
+ // FIXME: if entry calcuates its cursor position correctly and conformant works,
+ // genlist does not need to handle this focus thing.
+ evas_object_smart_callback_add(ic, "focused", _icon_focused, it);
+ evas_object_smart_callback_add(ic, "unfocused", _icon_unfocused, it);
}
}
}
if (!it->realized) return;
if (it->wd->reorder_it == it) return;
+ if (it->defer_unrealize) return;
evas_event_freeze(evas_object_evas_get(it->wd->obj));
if (!calc)
evas_object_smart_callback_call(it->base.widget, SIG_UNREALIZED, it);
it->block->updateme = EINA_TRUE;
if (it->wd->update_job) ecore_job_del(it->wd->update_job);
it->wd->update_job = ecore_job_add(_update_job, it->wd);
+ it->defer_unrealize = EINA_FALSE;
}
EAPI void