summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-01 13:55:06 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-03 20:40:11 +0200
commit7869778d02d862a0efd11857c3299cd391245551 (patch)
treec8c17dbd069c5aad48075b2f1d0995273274adc4 /src/bin
parent42bbe0e58ffcfda31d142dbaab9be99f7d84f1c7 (diff)
efl_ui_spin: move the step implementation to spin_button
having efl_ui_spin implementing efl.ui.range_interactive does not make sense. Efl.Ui.Spin is a not interactive widget, so it should not implement that interface. ref T7897 Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es> Differential Revision: https://phab.enlightenment.org/D9475
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/elementary/test_ui_spin.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/elementary/test_ui_spin.c b/src/bin/elementary/test_ui_spin.c
index b57dfac81a..6f325bb034 100644
--- a/src/bin/elementary/test_ui_spin.c
+++ b/src/bin/elementary/test_ui_spin.c
@@ -4,6 +4,8 @@
4#include <Efl_Ui.h> 4#include <Efl_Ui.h>
5#include <Elementary.h> 5#include <Elementary.h>
6 6
7#define STEP_SIZE 2
8
7static void 9static void
8_spin_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev) 10_spin_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
9{ 11{
@@ -23,13 +25,13 @@ _spin_max_reached_cb(void *data EINA_UNUSED, const Efl_Event *ev)
23static void 25static void
24_inc_clicked(void *data, const Efl_Event *ev EINA_UNUSED) 26_inc_clicked(void *data, const Efl_Event *ev EINA_UNUSED)
25{ 27{
26 efl_ui_range_value_set(data, (efl_ui_range_value_get(data) + efl_ui_range_step_get(data))); 28 efl_ui_range_value_set(data, (efl_ui_range_value_get(data) + STEP_SIZE));
27} 29}
28 30
29static void 31static void
30_dec_clicked(void *data, const Efl_Event *ev EINA_UNUSED) 32_dec_clicked(void *data, const Efl_Event *ev EINA_UNUSED)
31{ 33{
32 efl_ui_range_value_set(data, (efl_ui_range_value_get(data) - efl_ui_range_step_get(data))); 34 efl_ui_range_value_set(data, (efl_ui_range_value_get(data) - STEP_SIZE));
33} 35}
34 36
35void 37void
@@ -49,7 +51,6 @@ test_ui_spin(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
49 sp = efl_add(EFL_UI_SPIN_CLASS, bx, 51 sp = efl_add(EFL_UI_SPIN_CLASS, bx,
50 efl_ui_range_limits_set(efl_added, 0, 10), 52 efl_ui_range_limits_set(efl_added, 0, 10),
51 efl_ui_range_value_set(efl_added, 6), 53 efl_ui_range_value_set(efl_added, 6),
52 efl_ui_range_step_set(efl_added, 2),
53 efl_ui_format_string_set(efl_added, "test %d", EFL_UI_FORMAT_STRING_TYPE_SIMPLE), 54 efl_ui_format_string_set(efl_added, "test %d", EFL_UI_FORMAT_STRING_TYPE_SIMPLE),
54 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED,_spin_changed_cb, NULL), 55 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED,_spin_changed_cb, NULL),
55 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_MIN_REACHED,_spin_min_reached_cb, NULL), 56 efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_MIN_REACHED,_spin_min_reached_cb, NULL),