efl_ui_spin_button: check focus state
authorYeongjong Lee <cleanlyj@naver.com>
Fri, 1 Dec 2017 03:05:10 +0000 (12:05 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Fri, 1 Dec 2017 03:06:24 +0000 (12:06 +0900)
Summary:
Because toggle_entry function control entry focus, it need to check
focus state in focus changed callback

Test Plan:
1. elementary_test - Efl.Ui.Spin.Button
2. Click the entry of spin_button

Reviewers: Jaehyun_Cho, CHAN

Reviewed By: Jaehyun_Cho

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5569

src/lib/elementary/efl_ui_spin_button.c

index 23e149a..059c378 100644 (file)
@@ -494,9 +494,10 @@ _inc_dec_button_mouse_move_cb(void *data, const Efl_Event *event)
 }
 
 static void
-_text_button_focus_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
+_text_button_focus_changed_cb(void *data, const Efl_Event *event)
 {
-   _toggle_entry(data);
+   if (efl_ui_focus_object_focus_get(event->object))
+     _toggle_entry(data);
 }
 
 static void
@@ -506,9 +507,10 @@ _entry_activated_cb(void *data, const Efl_Event *event EINA_UNUSED)
 }
 
 static void
-_entry_focus_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
+_entry_focus_changed_cb(void *data, const Efl_Event *event)
 {
-   _toggle_entry(data);
+   if (!efl_ui_focus_object_focus_get(event->object))
+     _toggle_entry(data);
 }
 
 static void