#include <Widget/ProgressBar/ProgressBar.hpp>

ProgressBar::ProgressBar(GetProgressCallback getProgress) :
    getProgress(getProgress)
{}

void ProgressBar::draw(GraphicsContext &context)
{
    context.color = Color::progressBackground;
    context.drawRect(0, 0, m_size.x, m_size.y);

    context.color = Color::progressBar;
    context.drawRect(0, 0, m_size.x * getProgress(), m_size.y);
}

glm::ivec2 ProgressBar::getMinSize()
{
    return glm::ivec2(0, 4);
}