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 <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9226
This commit is contained in:
Marcel Hollerbach 2019-07-05 17:44:36 +02:00
parent c72ccdadfd
commit eaeb67e571
1 changed files with 2 additions and 14 deletions

View 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)
{