#pragma once

#include "Widget.h"

#include <string>

class TextNode;

class Label : public Widget
{

public:

    Label();

    virtual ~Label() = default;

    static std::unique_ptr<Label> Create();

    void setLabel(const std::string& text);

private:
    bool isDirty() const override;
    void doPaint(const PaintEvent* event) override;

    void updateLabel(const PaintEvent* event);

    std::string mLabel;
    std::unique_ptr<TextNode> mTextNode;
    bool mContentDirty{true};

};

using LabelUPtr = std::unique_ptr<Label>;
