summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-22 13:09:03 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-22 13:13:53 +0200
commit3fa5d40504d09fc0396afbd8c3e96a552fcc0559 (patch)
tree746778aebb9485989b35a6fc67ad7a15b77a4168
parent0fe136615e8646b7b049d3dff85f46e3b43cde20 (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
-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 e07839d068..8f9c8adbd6 100644
--- a/src/lib/elementary/efl_ui_progressbar.c
+++ b/src/lib/elementary/efl_ui_progressbar.c
@@ -572,8 +572,17 @@ _progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *pa
572 572
573 _val_set(obj); 573 _val_set(obj);
574 _units_set(obj); 574 _units_set(obj);
575 efl_event_callback_legacy_call 575 if (elm_widget_is_legacy(obj))
576 (obj, EFL_UI_RANGE_EVENT_CHANGED, NULL); 576 efl_event_callback_legacy_call
577 (obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
578 else
579 {
580 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_CHANGED, NULL);
581 if (sd->val == min)
582 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_MIN_REACHED, NULL);
583 if (sd->val == max)
584 efl_event_callback_call(obj, EFL_UI_RANGE_EVENT_MAX_REACHED, NULL);
585 }
577} 586}
578 587
579static double 588static double
diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c
index 0458faab83..f6d831f3f7 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);
@@ -778,6 +788,7 @@ _efl_ui_slider_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Slider_Data
778 if (sd->val < sd->val_min) sd->val = sd->val_min; 788 if (sd->val < sd->val_min) sd->val = sd->val_min;
779 if (sd->val > sd->val_max) sd->val = sd->val_max; 789 if (sd->val > sd->val_max) sd->val = sd->val_max;
780 790
791 _emit_events(obj, sd);
781 efl_ui_slider_val_set(obj); 792 efl_ui_slider_val_set(obj);
782} 793}
783 794