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)
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)
858 _val_inc_dec_start, data); 858 _val_inc_dec_start, data);
859 859
860 if (sd->entry_visible) _entry_value_apply(data); 860 if (sd->entry_visible) _entry_value_apply(data);
861 if (sd->entry_reactivate) sd->entry_reactivate = EINA_FALSE;
861} 862}
862 863
863static void 864static void
@@ -920,8 +921,19 @@ _elm_spinner_elm_widget_on_focus(Eo *obj, Elm_Spinner_Data *sd, Elm_Object_Item
920 ELM_SAFE_FREE(sd->delay_change_timer, ecore_timer_del); 921 ELM_SAFE_FREE(sd->delay_change_timer, ecore_timer_del);
921 ELM_SAFE_FREE(sd->spin_timer, ecore_timer_del); 922 ELM_SAFE_FREE(sd->spin_timer, ecore_timer_del);
922 923
924 if (sd->entry_visible) sd->entry_reactivate = EINA_TRUE;
925
923 _entry_value_apply(obj); 926 _entry_value_apply(obj);
924 } 927 }
928 else
929 {
930 if (sd->entry_reactivate)
931 {
932 _toggle_entry(obj);
933
934 sd->entry_reactivate = EINA_FALSE;
935 }
936 }
925 937
926 return EINA_TRUE; 938 return EINA_TRUE;
927} 939}
@@ -1377,7 +1389,11 @@ _elm_spinner_elm_widget_focus_next(Eo *obj, Elm_Spinner_Data *_pd, Elm_Focus_Dir
1377 if (_pd->entry_visible) 1389 if (_pd->entry_visible)
1378 items = eina_list_append(items, _pd->ent); 1390 items = eina_list_append(items, _pd->ent);
1379 else 1391 else
1380 items = eina_list_append(items, _pd->text_button); 1392 {
1393 if (_pd->entry_reactivate) _pd->entry_reactivate = EINA_FALSE;
1394
1395 items = eina_list_append(items, _pd->text_button);
1396 }
1381 1397
1382 } 1398 }
1383 return elm_widget_focus_list_next_get 1399 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
43 Eina_List *special_values; 43 Eina_List *special_values;
44 44
45 Eina_Bool entry_visible : 1; 45 Eina_Bool entry_visible : 1;
46 Eina_Bool entry_reactivate : 1;
46 Eina_Bool dragging : 1; 47 Eina_Bool dragging : 1;
47 Eina_Bool editable : 1; 48 Eina_Bool editable : 1;
48 Eina_Bool wrap : 1; 49 Eina_Bool wrap : 1;