Adding new gui to Sketch3d

This commit is contained in:
IlyaShurupov 2024-03-18 14:37:39 +03:00
parent ccdc8efd99
commit 87d8ce84dc
6 changed files with 134 additions and 10 deletions

View file

@ -8,6 +8,18 @@ namespace tp {
class ButtonWidget : public Widget<Events, Canvas> {
public:
ButtonWidget() {
this->mArea = { 0, 0, 100, 100 };
this->createConfig("Button");
this->addColor("Pressed", "Action");
this->addColor("Hovered", "Interaction");
this->addColor("Default", "Accent");
this->addValue("Rounding", "Rounding");
}
ButtonWidget(const String& label, const tp::RectF& aArea) {
this->mArea = aArea;
this->mLabel.mLabel = label;
this->createConfig("Button");
this->addColor("Pressed", "Action");
this->addColor("Hovered", "Interaction");

View file

@ -132,6 +132,12 @@ namespace tp {
this->addValue("Padding", "Padding");
}
~ScrollableWindow() {
for (auto content : mContents) {
delete content.data();
}
}
// takes whole area
void proc(const Events& events, const tp::RectF& areaParent, const tp::RectF& aArea) override {
this->mArea = aArea;