summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-22 13:09:03 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-07-31 10:18:20 +0200
commit8f7fa82244dd680b9928945ed8b3ba407f33e6b2 (patch)
tree624490b008c47e96eac9f293071773666199f1a9 /src/lib
parentc0082b1c71ed63f982bb4b9aed2af4b50d46dabe (diff)
efl_ui_*: add the new events to the widgets
previous commit introduced new events to range_display. This commit ensures correct emittation of those events. ref T7895 Differential Revision: https://phab.enlightenment.org/D9372
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elementary/efl_ui_progressbar.c13
-rw-r--r--src/lib/elementary/efl_ui_slider.c13
2 files changed, 23 insertions, 3 deletions
diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c
index 2386b82293..f80b40badb 100644
--- a/src/lib/elementary/efl_ui_progressbar.c
+++ b/src/lib/elementary/efl_ui_progressbar.c
@@ -558,8 +558,17 @@ _progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *pa
558 558
559 _val_set(obj); 559 _val_set(obj);
560 _units_set(obj); 560 _units_set(obj);
561 efl_event_callback_legacy_call 561 if (elm_widget_is_legacy(obj))
562 (obj, EFL_UI_RANGE_EVENT_CHANGED, NULL); 562 efl_event_callback_legacy_call
563 (obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
564 else
565 {
566 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
567 if (sd->val == min)
568 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_MIN_REACHED, NULL);
569 if (sd->val == max)
570 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_MAX_REACHED, NULL);
571 }
563} 572}
564 573
565static double 574static double
diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c
index 40c188241e..50a9fab57d 100644
--- a/src/lib/elementary/efl_ui_slider.c
+++ b/src/lib/elementary/efl_ui_slider.c
@@ -49,6 +49,16 @@ _is_horizontal(Efl_Ui_Layout_Orientation dir)
49} 49}
50 50
51static void 51static void
52_emit_events(Eo *obj, Efl_Ui_Slider_Data *sd)
53{
54 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
55 if (sd->val == sd->val_min)
56 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_MIN_REACHED, NULL);
57 if (sd->val == sd->val_max)
58 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_MAX_REACHED, NULL);
59}
60
61static void
52_efl_ui_slider_val_fetch(Evas_Object *obj, Efl_Ui_Slider_Data *sd, Eina_Bool user_event) 62_efl_ui_slider_val_fetch(Evas_Object *obj, Efl_Ui_Slider_Data *sd, Eina_Bool user_event)
53{ 63{
54 double posx = 0.0, posy = 0.0, pos = 0.0, val; 64 double posx = 0.0, posy = 0.0, pos = 0.0, val;
@@ -76,7 +86,7 @@ _efl_ui_slider_val_fetch(Evas_Object *obj, Efl_Ui_Slider_Data *sd, Eina_Bool us
76 sd->val = val; 86 sd->val = val;
77 if (user_event) 87 if (user_event)
78 { 88 {
79 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL); 89 _emit_events(obj, sd);
80 efl_event_callback_legacy_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL); 90 efl_event_callback_legacy_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
81 ecore_timer_del(sd->delay); 91 ecore_timer_del(sd->delay);
82 sd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj); 92 sd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj);
@@ -765,6 +775,7 @@ _efl_ui_slider_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Slider_Data
765 if (sd->val < sd->val_min) sd->val = sd->val_min; 775 if (sd->val < sd->val_min) sd->val = sd->val_min;
766 if (sd->val > sd->val_max) sd->val = sd->val_max; 776 if (sd->val > sd->val_max) sd->val = sd->val_max;
767 777
778 _emit_events(obj, sd);
768 efl_ui_slider_val_set(obj); 779 efl_ui_slider_val_set(obj);
769} 780}
770 781