summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2019-07-11 03:35:58 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-11 07:30:53 +0200
commitd8fcd8d3001cab527adb4f3483fa3e447678ed16 (patch)
treefe1202ff6707fd11043f098622feae44f5894e74
parentfcaec534a3afec74557cb168ab656735067e7d5b (diff)
efl_ui_*: fix regressions on legacy side
elm_progressbar_value_set with value bigger than max (or less than min) set to max value instead of the bigger value. Following commit broke this behavior. 5efb4b3 efl_ui_*: get range users onto the same semantics Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9277
-rw-r--r--src/lib/elementary/efl_ui_progressbar.c25
-rw-r--r--src/lib/elementary/efl_ui_slider.c20
2 files changed, 24 insertions, 21 deletions
diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c
index f085924893..522166f7cf 100644
--- a/src/lib/elementary/efl_ui_progressbar.c
+++ b/src/lib/elementary/efl_ui_progressbar.c
@@ -593,23 +593,24 @@ _progressbar_part_value_get(Efl_Ui_Progressbar_Data *sd, const char* part)
593EOLIAN static void 593EOLIAN static void
594_efl_ui_progressbar_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, double val) 594_efl_ui_progressbar_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, double val)
595{ 595{
596 if (val < sd->val_min)
597 {
598 ERR("Error, value is less than minimum");
599 return;
600 }
601
602 if (val > sd->val_max)
603 {
604 ERR("Error, value is greater than maximum");
605 return;
606 }
607 if (EINA_DBL_EQ(sd->val, val)) return; 596 if (EINA_DBL_EQ(sd->val, val)) return;
608 597
609 if (elm_widget_is_legacy(obj)) 598 if (elm_widget_is_legacy(obj))
610 _progressbar_part_value_set(obj, sd, "elm.cur.progressbar", val); 599 _progressbar_part_value_set(obj, sd, "elm.cur.progressbar", val);
611 else 600 else
612 _progressbar_part_value_set(obj, sd, "efl.cur.progressbar", val); 601 {
602 if (val < sd->val_min)
603 {
604 ERR("Error, value is less than minimum");
605 return;
606 }
607 if (val > sd->val_max)
608 {
609 ERR("Error, value is greater than maximum");
610 return;
611 }
612 _progressbar_part_value_set(obj, sd, "efl.cur.progressbar", val);
613 }
613} 614}
614 615
615EOLIAN static double 616EOLIAN static double
diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c
index 3a6de63a26..2eb3f28ac7 100644
--- a/src/lib/elementary/efl_ui_slider.c
+++ b/src/lib/elementary/efl_ui_slider.c
@@ -748,16 +748,18 @@ _efl_ui_slider_efl_ui_range_display_range_limits_get(const Eo *obj EINA_UNUSED,
748EOLIAN static void 748EOLIAN static void
749_efl_ui_slider_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Slider_Data *sd, double val) 749_efl_ui_slider_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Slider_Data *sd, double val)
750{ 750{
751 if (val < sd->val_min) 751 if (!elm_widget_is_legacy(obj))
752 { 752 {
753 ERR("Error, value is less than minimum"); 753 if (val < sd->val_min)
754 return; 754 {
755 } 755 ERR("Error, value is less than minimum");
756 756 return;
757 if (val > sd->val_max) 757 }
758 { 758 if (val > sd->val_max)
759 ERR("Error, value is greater than maximum"); 759 {
760 return; 760 ERR("Error, value is greater than maximum");
761 return;
762 }
761 } 763 }
762 764
763 if (EINA_DBL_EQ(val, sd->val)) return; 765 if (EINA_DBL_EQ(val, sd->val)) return;