summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-02 17:46:46 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-02 17:48:16 +0100
commit2553005a9606ac642c8db80bff6da1dfc5bb80ca (patch)
tree4d01ba51643740d9ef6e1e19dfa2916e1e7d4b80
parent93cc296b235360428cd1f4474939703d7a0d6a50 (diff)
downloadefl-2553005a9606ac642c8db80bff6da1dfc5bb80ca.tar.gz
asdf
-rw-r--r--src/lib/elementary/efl_ui_spin_button.c6
-rw-r--r--src/tests/elementary/efl_ui_test_spin_button.c23
-rw-r--r--src/tests/elementary/suite_helpers.c2
3 files changed, 31 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_spin_button.c b/src/lib/elementary/efl_ui_spin_button.c
index 514272fae4..47c60063dc 100644
--- a/src/lib/elementary/efl_ui_spin_button.c
+++ b/src/lib/elementary/efl_ui_spin_button.c
@@ -406,8 +406,12 @@ _spin_value(Efl_Ui_Spin *obj, Eina_Bool inc)
{
Efl_Ui_Spin_Button_Data *pd = efl_data_scope_get(obj, EFL_UI_SPIN_BUTTON_CLASS);
+ printf("1.: %f\n", pd->step);
+
double absolut_value = efl_ui_range_value_get(obj) + (inc ? pd->step : -pd->step);
+ printf("2.: %f\n", absolut_value);
+
_value_set(obj, absolut_value);
}
@@ -416,6 +420,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);
+ printf("--> PRESSED\n");
+
if (sd->entry_visible) _entry_value_apply(data);
_spin_value(data, sd->inc_button == event->object);
diff --git a/src/tests/elementary/efl_ui_test_spin_button.c b/src/tests/elementary/efl_ui_test_spin_button.c
index 4daf08a3ca..22d919aa4d 100644
--- a/src/tests/elementary/efl_ui_test_spin_button.c
+++ b/src/tests/elementary/efl_ui_test_spin_button.c
@@ -173,6 +173,28 @@ EFL_START_TEST (spin_wraparound)
}
EFL_END_TEST
+EFL_START_TEST (spin_double_values)
+{
+ efl_ui_range_limits_set(spin, 10, 30);
+ efl_ui_range_value_set(spin, 20);
+ efl_ui_range_step_set(spin, 0.1);
+
+ printf("=======================================>\n");
+
+ for (int i = 0; i < 5; ++i)
+ {
+ printf("-> %d \n", i);
+ click_spin_part(spin, "efl.inc_button");
+ //get_me_to_those_events(spin);
+ }
+ #ifdef ck_assert_double_eq
+ ck_assert_double_eq(efl_ui_range_value_get(spin), 20.5);
+ #else
+ ck_assert_int_eq(EINA_DBL_EQ(efl_ui_range_value_get(spin), 20.5), 1);
+ #endif
+}
+EFL_END_TEST
+
void efl_ui_test_spin_button(TCase *tc)
{
tcase_add_checked_fixture(tc, fail_on_errors_setup, fail_on_errors_teardown);
@@ -182,4 +204,5 @@ void efl_ui_test_spin_button(TCase *tc)
tcase_add_test(tc, spin_value_inc_max);
tcase_add_test(tc, spin_value_dec_min);
tcase_add_test(tc, spin_wraparound);
+ tcase_add_test(tc, spin_double_values);
}
diff --git a/src/tests/elementary/suite_helpers.c b/src/tests/elementary/suite_helpers.c
index 53c473a9fa..e6505e38d6 100644
--- a/src/tests/elementary/suite_helpers.c
+++ b/src/tests/elementary/suite_helpers.c
@@ -454,6 +454,7 @@ click_object_internal(Eo *obj, int dir, int flags)
{
Evas *e = evas_object_evas_get(obj);
Eina_Position2D pos = attempt_to_find_the_right_point_for_mouse_positioning(obj, dir);
+ printf("---> CLICKING %d %d\n", pos.x, pos.y);
evas_event_feed_mouse_move(e, pos.x, pos.y, 0, NULL);
evas_event_feed_mouse_down(e, 1, flags, 0, NULL);
evas_event_feed_mouse_up(e, 1, 0, 0, NULL);
@@ -492,6 +493,7 @@ click_part_flags(Eo *obj, const char *part, int flags)
else if (strstr(part, "bottom"))
dir |= BOTTOM;
}
+ printf("---> INTERNAL %p\n", content);
click_object_internal(content, dir, flags);
if (efl_isa(content, EFL_LAYOUT_SIGNAL_INTERFACE))
edje_object_message_signal_process(content);