diff --git a/Include/RmlUi/Core/Elements/ElementProgressBar.h b/Include/RmlUi/Core/Elements/ElementProgressBar.h index 494dda404..d9af189d3 100644 --- a/Include/RmlUi/Core/Elements/ElementProgressBar.h +++ b/Include/RmlUi/Core/Elements/ElementProgressBar.h @@ -69,12 +69,13 @@ class RMLUICORE_API ElementProgressBar : public Element /// Returns the value of the progress bar. float GetValue() const; + /// Sets the value of the progress bar. + void SetValue(float value); /// Returns the maximum value of the progress bar. float GetMax() const; - - /// Sets the value of the progress bar. - void SetValue(float value); + /// Sets the maximum value of the progress bar. + void SetMax(float max_value); /// Returns the element's inherent size. bool GetIntrinsicDimensions(Vector2f& dimensions, float& ratio) override; diff --git a/Source/Core/Elements/ElementProgressBar.cpp b/Source/Core/Elements/ElementProgressBar.cpp index 3d6a43050..8ef7c6f08 100644 --- a/Source/Core/Elements/ElementProgressBar.cpp +++ b/Source/Core/Elements/ElementProgressBar.cpp @@ -65,6 +65,11 @@ float ElementProgressBar::GetMax() const return max_value <= 0.0f ? 1.0f : max_value; } +void ElementProgressBar::SetMax(float max_value) +{ + SetAttribute("max", max_value); +} + void ElementProgressBar::SetValue(float in_value) { SetAttribute("value", in_value);