summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Kroitor <an.kroitor@samsung.com>2015-09-29 08:54:34 +0100
committerAndy Williams <andy@andywilliams.me>2015-09-29 08:59:13 +0100
commit8a3b1272f9d1d526b1f5d6e08fe2841fb580b4c2 (patch)
treec5b9ba0a3a5d9738bfbc9573d0224336f7d49a3b
parentb47a332cd2599f84334c3408676ec704a9361029 (diff)
spinner: fix extra callback calls
After a52a53802aebf03d297aa857f0cb6a9779949a49 callback was called after every spinner value change even if it was made from code. This commit fixes unfocus issues without breaking callbacks logic @fix Reviewers: CHAN, ajwillia.ms Subscribers: CHAN, ajwillia.ms Differential Revision: https://phab.enlightenment.org/D3107 Signed-off-by: Andy Williams
-rw-r--r--src/lib/elm_spinner.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c
index 2cc309cd2..530cba90a 100644
--- a/src/lib/elm_spinner.c
+++ b/src/lib/elm_spinner.c
@@ -216,8 +216,6 @@ _val_set(Evas_Object *obj)
216 pos = 1.0; 216 pos = 1.0;
217 edje_object_part_drag_value_set 217 edje_object_part_drag_value_set
218 (wd->resize_obj, "elm.dragable.slider", pos, pos); 218 (wd->resize_obj, "elm.dragable.slider", pos, pos);
219
220 eo_do(obj, eo_event_callback_call(ELM_SPINNER_EVENT_CHANGED, NULL));
221} 219}
222 220
223static void 221static void
@@ -324,8 +322,13 @@ _entry_value_apply(Evas_Object *obj)
324 str = elm_object_text_get(sd->ent); 322 str = elm_object_text_get(sd->ent);
325 if (!str) return; 323 if (!str) return;
326 val = strtod(str, &end); 324 val = strtod(str, &end);
327 if ((*end != '\0') && (!isspace(*end))) return; 325 if (((*end != '\0') && (!isspace(*end))) || (fabs(val - sd->val) < DBL_EPSILON)) return;
328 elm_spinner_value_set(obj, val); 326 elm_spinner_value_set(obj, val);
327
328 eo_do(obj, eo_event_callback_call(ELM_SPINNER_EVENT_CHANGED, NULL));
329 ecore_timer_del(sd->delay_change_timer);
330 sd->delay_change_timer = ecore_timer_add(ELM_SPINNER_DELAY_CHANGE_TIME,
331 _delay_change_timer_cb, obj);
329} 332}
330 333
331static Eina_Bool 334static Eina_Bool
@@ -333,13 +336,7 @@ _entry_activated_cb(void *data,
333 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, 336 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
334 void *event_info EINA_UNUSED) 337 void *event_info EINA_UNUSED)
335{ 338{
336 ELM_SPINNER_DATA_GET(data, sd);
337
338 _entry_value_apply(data); 339 _entry_value_apply(data);
339 eo_do(data, eo_event_callback_call(ELM_SPINNER_EVENT_CHANGED, NULL));
340 ecore_timer_del(sd->delay_change_timer);
341 sd->delay_change_timer = ecore_timer_add(ELM_SPINNER_DELAY_CHANGE_TIME,
342 _delay_change_timer_cb, data);
343 340
344 return EINA_TRUE; 341 return EINA_TRUE;
345} 342}