#ifndef FRAME_HPP_
#define FRAME_HPP_

#include <Widget/Layout/Layout.hpp>

/**
 * @brief The 'frame' layout, shows a widget with a (by default) dark blue background.
 */
class Frame : public Layout
{
private:
    int margin = 4;

    glm::vec4 color;

public:
    /**
     * @brief Construct a new frame.
     * 
     * @param child The widget to display.
     */
    Frame(Widget *child);

    /**
     * @brief Construct a new frame.
     * 
     * @param color The background color.
     * @param child The child.
     */
    Frame(glm::vec4 color, Widget *child);

    /**
     * @brief Change the size of the margin, and return this frame.
     */
    Frame* withMargin(int margin);

    virtual void layout() override;
    virtual glm::ivec2 getMinSize() override;
    virtual void draw(GraphicsContext &context) override;
};

#endif