From 34643a79cbb6905c3ac90d529512bd826ebd1b15 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Fri, 5 Jul 2019 17:44:36 +0200 Subject: [PATCH] efl_ui_spin_button: change entry to button before changing value doing this in pressed is kind of weird, if you are on a touchscreen, missclick, and move the finger away, the entry is already transformed, which is weird, this fixes that. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D9226 --- src/lib/elementary/efl_ui_spin_button.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/lib/elementary/efl_ui_spin_button.c b/src/lib/elementary/efl_ui_spin_button.c index 4c7aaf2..ebdf2ca 100644 --- a/src/lib/elementary/efl_ui_spin_button.c +++ b/src/lib/elementary/efl_ui_spin_button.c @@ -29,8 +29,6 @@ static const char PART_NAME_INC_BUTTON[] = "inc_button"; static void _inc_dec_button_clicked_cb(void *data, const Efl_Event *event); static void -_inc_dec_button_pressed_cb(void *data, const Efl_Event *event); -static void _entry_activated_cb(void *data, const Efl_Event *event); static void _entry_focus_changed_cb(void *data, const Efl_Event *event); @@ -40,7 +38,6 @@ _access_increment_decrement_info_say(Evas_Object *obj, Eina_Bool is_incremented) EFL_CALLBACKS_ARRAY_DEFINE(_inc_dec_button_cb, { EFL_UI_EVENT_CLICKED, _inc_dec_button_clicked_cb}, { EFL_UI_AUTOREPEAT_EVENT_REPEATED, _inc_dec_button_clicked_cb}, - { EFL_UI_EVENT_PRESSED, _inc_dec_button_pressed_cb} ); static void @@ -416,6 +413,8 @@ _inc_dec_button_clicked_cb(void *data, const Efl_Event *event) { Efl_Ui_Spin_Button_Data *sd = efl_data_scope_get(data, MY_CLASS); + if (sd->entry_visible) _entry_value_apply(data); + sd->inc_val = sd->inc_button == event->object ? EINA_TRUE : EINA_FALSE; _spin_value(data); @@ -423,17 +422,6 @@ _inc_dec_button_clicked_cb(void *data, const Efl_Event *event) _access_increment_decrement_info_say(data, EINA_TRUE); } - -static void -_inc_dec_button_pressed_cb(void *data, const Efl_Event *event) -{ - Efl_Ui_Spin_Button_Data *sd = efl_data_scope_get(data, MY_CLASS); - - sd->inc_val = sd->inc_button == event->object ? EINA_TRUE : EINA_FALSE; - - if (sd->entry_visible) _entry_value_apply(data); -} - static void _text_button_focus_changed_cb(void *data, const Efl_Event *event) { -- 2.7.4