forked from enlightenment/efl
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
This commit is contained in:
parent
fcaec534a3
commit
d8fcd8d300
|
@ -593,23 +593,24 @@ _progressbar_part_value_get(Efl_Ui_Progressbar_Data *sd, const char* part)
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_ui_progressbar_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, double val)
|
_efl_ui_progressbar_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, double val)
|
||||||
{
|
{
|
||||||
if (val < sd->val_min)
|
|
||||||
{
|
|
||||||
ERR("Error, value is less than minimum");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (val > sd->val_max)
|
|
||||||
{
|
|
||||||
ERR("Error, value is greater than maximum");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (EINA_DBL_EQ(sd->val, val)) return;
|
if (EINA_DBL_EQ(sd->val, val)) return;
|
||||||
|
|
||||||
if (elm_widget_is_legacy(obj))
|
if (elm_widget_is_legacy(obj))
|
||||||
_progressbar_part_value_set(obj, sd, "elm.cur.progressbar", val);
|
_progressbar_part_value_set(obj, sd, "elm.cur.progressbar", val);
|
||||||
else
|
else
|
||||||
_progressbar_part_value_set(obj, sd, "efl.cur.progressbar", val);
|
{
|
||||||
|
if (val < sd->val_min)
|
||||||
|
{
|
||||||
|
ERR("Error, value is less than minimum");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (val > sd->val_max)
|
||||||
|
{
|
||||||
|
ERR("Error, value is greater than maximum");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_progressbar_part_value_set(obj, sd, "efl.cur.progressbar", val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static double
|
EOLIAN static double
|
||||||
|
|
|
@ -748,16 +748,18 @@ _efl_ui_slider_efl_ui_range_display_range_limits_get(const Eo *obj EINA_UNUSED,
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_ui_slider_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Slider_Data *sd, double val)
|
_efl_ui_slider_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Slider_Data *sd, double val)
|
||||||
{
|
{
|
||||||
if (val < sd->val_min)
|
if (!elm_widget_is_legacy(obj))
|
||||||
{
|
{
|
||||||
ERR("Error, value is less than minimum");
|
if (val < sd->val_min)
|
||||||
return;
|
{
|
||||||
}
|
ERR("Error, value is less than minimum");
|
||||||
|
return;
|
||||||
if (val > sd->val_max)
|
}
|
||||||
{
|
if (val > sd->val_max)
|
||||||
ERR("Error, value is greater than maximum");
|
{
|
||||||
return;
|
ERR("Error, value is greater than maximum");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EINA_DBL_EQ(val, sd->val)) return;
|
if (EINA_DBL_EQ(val, sd->val)) return;
|
||||||
|
|
Loading…
Reference in New Issue