elementary: on focus loss actually hide the entry and show label.

SVN revision: 74819
This commit is contained in:
Cedric BAIL 2012-08-03 07:27:02 +00:00
parent 3148dd42af
commit eefbaaba3d
4 changed files with 15 additions and 0 deletions

View File

@ -370,3 +370,4 @@
2012-08-03 Cedric Bail
* Add smart callback "focus-in" and "focus-out".
* On focus loss, Elm_Spinner hide entry and display label properly.

View File

@ -20,6 +20,7 @@ Additions:
* Elm_Win_Trap and elm_win_trap_set() to allow e17 integration.
* elm_flip_go_to()
* Add smart callback "focus-in" and "focus-out" when an Elementary object gain or loose focus.
* On focus loss, Elm_Spinner properly hide Elm_Entry and display label properly.
Fixes:

View File

@ -465,6 +465,16 @@ _elm_spinner_smart_event(Evas_Object *obj,
return EINA_FALSE;
}
static void
_on_focus_out(void *data,
Evas_Object *obj __UNUSED__,
void *event_info __UNUSED__)
{
Evas_Object *spinner = data;
_entry_value_apply(spinner);
}
static void
_elm_spinner_smart_add(Evas_Object *obj)
{
@ -502,6 +512,7 @@ _elm_spinner_smart_add(Evas_Object *obj)
priv->ent = elm_entry_add(obj);
elm_entry_single_line_set(priv->ent, EINA_TRUE);
evas_object_smart_callback_add(priv->ent, "focus-out", _on_focus_out, obj);
evas_object_smart_callback_add
(priv->ent, "activated", _entry_activated_cb, obj);

View File

@ -135,6 +135,8 @@ struct _Elm_Spinner_Smart_Data
Ecore_Timer *delay, *spin;
Eina_List *special_values;
void (*entry_focus_hook)(void *data, Evas_Object *obj);
Eina_Bool entry_visible : 1;
Eina_Bool dragging : 1;
Eina_Bool editable : 1;