Eina_Value val;
eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE);
- if (!sd->is_legacy_format)
- eina_value_set(&val, sd->val);
- else // Keeping this bug since the legacy code was like that.
+ eina_value_set(&val, sd->val);
+
+ // Keeping this bug since the legacy code was like that.
+ if (sd->is_legacy_format_string && !sd->is_legacy_format_cb)
eina_value_set(&val, 100 * sd->val);
eina_strbuf_reset(sd->format_strbuf);
EAPI void
elm_progressbar_unit_format_function_set(Evas_Object *obj, progressbar_func_type func, progressbar_freefunc_type free_func)
{
+ EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(obj, sd);
Pb_Format_Wrapper_Data *pfwd = malloc(sizeof(Pb_Format_Wrapper_Data));
pfwd->format_cb = func;
pfwd->format_free_cb = free_func;
+ sd->is_legacy_format_cb = EINA_TRUE;
efl_ui_format_cb_set(obj, pfwd, _format_legacy_to_format_eo_cb,
_format_legacy_to_format_eo_free_cb);
EAPI void
elm_progressbar_unit_format_set(Evas_Object *obj, const char *units)
{
- EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(obj, sd);
-
- sd->is_legacy_format = EINA_TRUE;
+ EFL_UI_PROGRESSBAR_DATA_GET_OR_RETURN(obj, sd);
+ sd->is_legacy_format_string = EINA_TRUE;
efl_ui_format_string_set(obj, units);
}
Eina_Bool pulse : 1; /**< Whether object is put in the pulsing mode */
Eina_Bool pulse_state : 1; /**< To start the pulsing animation, otherwise to stop it */
- Eina_Bool is_legacy_format : 1;
+ Eina_Bool is_legacy_format_string : 1;
+ Eina_Bool is_legacy_format_cb : 1;
};
struct _Efl_Ui_Progress_Status