Sizing fixes

This commit is contained in:
IlyaShurupov 2024-10-11 15:17:01 +03:00 committed by Ilya Shurupov
parent a36386cc20
commit c94f5144e7
4 changed files with 20 additions and 11 deletions

View file

@ -16,6 +16,7 @@ void RootWidget::processFrame(EventHandler* events, const RectF& screenArea) {
if (mDebug) {
mScreenArea.size -= { 400, 0 };
events->setEnableKeyEvents(true);
if (events->isPressed(InputID::K)) mDebugStopProcessing = !mDebugStopProcessing;
if (mDebugStopProcessing) return;
}

View file

@ -209,6 +209,10 @@ void Widget::adjustLayout(bool vertical) {
Vec2F availableSize = getRelativeAreaT().size;
for (auto child : mChildren) {
if (child->mSizePolicy[!vertical] != SizePolicy::Minimal) {
child->pickRect();
}
if (child->mSizePolicy[vertical] == SizePolicy::Expanding) {
contributors.emplace_back( child, true );
@ -217,8 +221,6 @@ void Widget::adjustLayout(bool vertical) {
child->setAreaCache(area);
child->clampRect();
} else {
// child->triggerWidgetUpdate("expand child in layout");
}
contentSize += child->getAreaCache().size;
}