#include <Widget/Layout/CompoundWidget/FormSection/FormSection.hpp>
#include <Widget/Layout/Margin/Margin.hpp>

FormSection::FormSection(Widget *child) : CompoundWidget(
    new Margin<2 * margin>(
        child
    )
)
{}

void FormSection::draw(GraphicsContext &context)
{
    context.color = Color::sectionBackground;
    context.drawRect(margin, margin, m_size.x - 2 * margin, m_size.y - 2 * margin);
    
    context.color = glm::vec4(1.0f);
    CompoundWidget::draw(context);
}