#ifndef PROGRESS_ICON_HPP_
#define PROGRESS_ICON_HPP_

#include <Material/Material.hpp>
#include <Widget/Widget.hpp>
#include <functional>

/**
 * @brief An icon for a progress element (milestone or achievement).
 *
 * This is the widget shown on progress graphs which allows the user to click.
 */
class ProgressIcon : public Widget
{
public:
    typedef std::function<void()> ClickCallback;

private:
    Material &icon;
    std::string label;
    bool obtained;
    ClickCallback onClicked;

public:
    ProgressIcon(
        Material &icon,
        std::string label,
        bool obtained,
        ClickCallback onClicked
    );

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

#endif