stuff-from-scratch/src/ui/ui_controls/Label.h
2023-01-17 10:13:25 +00:00

34 lines
535 B
C++

#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>;