1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibGUI: Rename ProgressBar property caption => text and expose to GML

This commit is contained in:
Andreas Kling 2020-12-20 12:29:40 +01:00
parent 92afdd0c86
commit de08e7b8c9
4 changed files with 6 additions and 5 deletions

View file

@ -34,6 +34,7 @@ namespace GUI {
ProgressBar::ProgressBar()
{
REGISTER_STRING_PROPERTY("text", text, set_text);
}
ProgressBar::~ProgressBar()
@ -70,7 +71,7 @@ void ProgressBar::paint_event(PaintEvent& event)
// Then we draw the progress text over the gradient.
// We draw it twice, once offset (1, 1) for a drop shadow look.
StringBuilder builder;
builder.append(m_caption);
builder.append(m_text);
if (m_format == Format::Percentage) {
float range_size = m_max - m_min;
float progress = (m_value - m_min) / range_size;