spinner: spinner entry reactivate when focus come again.

Summary:
When user edit spinner value on entry.
The user want to back on entry to edit spinner value even swiching view(focus out and focus in).

I considered a couple of exception case ( case that entry should not reactivate.)
1. User click spinner button to give focus.
2. User give focus to spinner's object using key action.

Test Plan:
Add sample in elementary_test.
Edit spinner value.
Gives focus to other window.
Back to spinner view.
See the action.

Reviewers: Hermet, woohyun, cedric, jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4120
This commit is contained in:
Woochan Lee 2016-07-04 19:55:53 +09:00 committed by Jean-Philippe Andre
parent b8fd5e875a
commit 186d9938cd
2 changed files with 18 additions and 1 deletions

View File

@ -858,6 +858,7 @@ _inc_dec_button_pressed_cb(void *data, const Eo_Event *event)
_val_inc_dec_start, data);
if (sd->entry_visible) _entry_value_apply(data);
if (sd->entry_reactivate) sd->entry_reactivate = EINA_FALSE;
}
static void
@ -920,8 +921,19 @@ _elm_spinner_elm_widget_on_focus(Eo *obj, Elm_Spinner_Data *sd, Elm_Object_Item
ELM_SAFE_FREE(sd->delay_change_timer, ecore_timer_del);
ELM_SAFE_FREE(sd->spin_timer, ecore_timer_del);
if (sd->entry_visible) sd->entry_reactivate = EINA_TRUE;
_entry_value_apply(obj);
}
else
{
if (sd->entry_reactivate)
{
_toggle_entry(obj);
sd->entry_reactivate = EINA_FALSE;
}
}
return EINA_TRUE;
}
@ -1377,7 +1389,11 @@ _elm_spinner_elm_widget_focus_next(Eo *obj, Elm_Spinner_Data *_pd, Elm_Focus_Dir
if (_pd->entry_visible)
items = eina_list_append(items, _pd->ent);
else
items = eina_list_append(items, _pd->text_button);
{
if (_pd->entry_reactivate) _pd->entry_reactivate = EINA_FALSE;
items = eina_list_append(items, _pd->text_button);
}
}
return elm_widget_focus_list_next_get

View File

@ -43,6 +43,7 @@ struct _Elm_Spinner_Data
Eina_List *special_values;
Eina_Bool entry_visible : 1;
Eina_Bool entry_reactivate : 1;
Eina_Bool dragging : 1;
Eina_Bool editable : 1;
Eina_Bool wrap : 1;