Widgets Additions and sketch3d new gui
This commit is contained in:
parent
afad2c80e5
commit
e10a494223
44 changed files with 1015 additions and 322 deletions
32
Widgets/private/layouts/SimpleLayouts.cpp
Normal file
32
Widgets/private/layouts/SimpleLayouts.cpp
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue