#pragma once #include "WidgetBase.hpp" namespace tp { template class LabelWidget : public Widget { public: LabelWidget() { this->createConfig("Label"); this->addValue("Size", "FontSize"); this->addValue("Padding", "Padding"); this->addColor("Default", "Front"); } void proc(const Events& events, const tp::RectF& areaParent, const tp::RectF& aArea) override { this->mArea = aArea; this->mVisible = areaParent.isOverlap(aArea); if (!this->mVisible) return; } void draw(Canvas& canvas) override { if (!this->mVisible) return; canvas.text( mLabel.read(), this->mArea, this->getValue("Size"), Canvas::CC, this->getValue("Padding"), this->getColor("Default") ); } public: String mLabel = "Label"; }; }