summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWoochan Lee <wc0917.lee@samsung.com>2016-07-04 19:55:53 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-07-04 19:55:53 +0900
commit186d9938cd56ae94cededa32136b6f06080fe6e6 (patch)
tree3872e4137cd2550b1d8395027ea63bfec370e099
parentb8fd5e875ab67cd76467d2fdb52130aff14d4dfd (diff)
downloadefl-186d9938cd56ae94cededa32136b6f06080fe6e6.tar.gz
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
-rw-r--r--src/lib/elementary/elm_spinner.c18
-rw-r--r--src/lib/elementary/elm_widget_spinner.h1
2 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_spinner.c b/src/lib/elementary/elm_spinner.c
index f128ba83ae..d2701f5d96 100644
--- a/src/lib/elementary/elm_spinner.c
+++ b/src/lib/elementary/elm_spinner.c
@@ -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
diff --git a/src/lib/elementary/elm_widget_spinner.h b/src/lib/elementary/elm_widget_spinner.h
index 85af775119..390c63b7da 100644
--- a/src/lib/elementary/elm_widget_spinner.h
+++ b/src/lib/elementary/elm_widget_spinner.h
@@ -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;