#pragma once #include "Widget.hpp" #include "Painter.hpp" namespace Raven { class Label : public Widget { public: Label(std::string text) : Widget(WidgetType::Label) , m_text(text) {} Label(std::string text, PaintTextAlign align) : Widget(WidgetType::Label) , m_text(text) , m_align(align) {} ~Label() {} void set_text(std::string text); std::string &text() { return m_text; } PaintTextAlign &align() { return m_align; } void set_align(PaintTextAlign align) { m_align = align; } protected: void on_paint(); void on_init(); private: std::string m_text; PaintTextAlign m_align { PaintTextAlign::Left }; }; }