Widgets Additions and sketch3d new gui

This commit is contained in:
IlyaShurupov 2024-10-20 12:01:42 +03:00 committed by Ilya Shurupov
parent afad2c80e5
commit e10a494223
44 changed files with 1015 additions and 322 deletions

View file

@ -0,0 +1,32 @@
#include "SimpleLayouts.hpp"
#include "Widget.hpp"
using namespace tp;
void OverlayLayout::updateLayout(bool vertical) {
if (vertical) return;
if (children().empty()) return;
for (auto child : children()) {
child->getLayout()->setArea(getArea().relative());
}
}
void ToolBarLayout::updateLayout(bool vertical) {
if (vertical) return;
if (children().size() != 2) return;
auto toolbar = children().back();
auto content = children().front();
auto factor = mToolBarHeight / getArea().w;
auto area = getArea().relative();
toolbar->getLayout()->setArea(area.splitByFactorVT(factor));
content->getLayout()->setArea(area);
}