Skip to content

Commit

Permalink
Minor update on progress bar interface
Browse files Browse the repository at this point in the history
  • Loading branch information
mikke89 committed Apr 15, 2021
1 parent 6687833 commit 4686c0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Include/RmlUi/Core/Elements/ElementProgressBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions Source/Core/Elements/ElementProgressBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4686c0c

Please sign in to comment.