efl_ui_spin_button: change entry to button before changing value
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Fri, 5 Jul 2019 15:44:36 +0000 (17:44 +0200)
committerShinwoo Kim <cinoo.kim@samsung.com>
Wed, 10 Jul 2019 02:19:18 +0000 (11:19 +0900)
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 <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9226

src/lib/elementary/efl_ui_spin_button.c

index 4c7aaf2..ebdf2ca 100644 (file)
@@ -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)
 {