#ifndef MENU_BUTTON_HPP_
#define MENU_BUTTON_HPP_

#include <Utilities/StandardLerping.hpp>
#include <Widget/Layout/Layout.hpp>
#include <functional>

/**
 * @brief A clickable menu button widget.
 */
class MenuButton : public Layout
{
public:
    typedef std::function<void()> Callback;

private:
    static constexpr int margin = 1;

    Callback onActivated;
    StandardLerping<glm::vec4> backgroundColor;

public:
    MenuButton(Widget *child, Callback onActivated);
    MenuButton(std::string label, Callback onActivated);

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

#endif