From 6169a6e3d148db0d281a085e514abe6f28a64d9b Mon Sep 17 00:00:00 2001 From: Alex Wilson Date: Tue, 24 Jan 2012 10:17:10 +1300 Subject: [PATCH] Minimize the effect invisible items have on a BALMLayout. There seems to still be some effect on positioning, but invisible items no longer constrain the layout. --- src/libs/alm/Area.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/libs/alm/Area.cpp b/src/libs/alm/Area.cpp index abc1dc9280..20acc6c369 100644 --- a/src/libs/alm/Area.cpp +++ b/src/libs/alm/Area.cpp @@ -571,6 +571,9 @@ Area::_DoLayout(const BPoint& offset) if (!fLeft) return; + if (!fLayoutItem->IsVisible()) + fLayoutItem->AlignInFrame(BRect(0, 0, -1, -1)); + BRect areaFrame(Frame()); areaFrame.left += LeftInset(); areaFrame.right -= RightInset(); @@ -584,6 +587,12 @@ Area::_DoLayout(const BPoint& offset) void Area::_UpdateMinSizeConstraint(BSize min) { + if (!fLayoutItem->IsVisible()) { + fMinContentHeight->SetRightSide(-1); + fMinContentWidth->SetRightSide(-1); + return; + } + float width = 0.; float height = 0.; if (min.width > 0) @@ -599,6 +608,12 @@ Area::_UpdateMinSizeConstraint(BSize min) void Area::_UpdateMaxSizeConstraint(BSize max) { + if (!fLayoutItem->IsVisible()) { + fMaxContentHeight->SetRightSide(B_SIZE_UNLIMITED); + fMaxContentWidth->SetRightSide(B_SIZE_UNLIMITED); + return; + } + max.width += LeftInset() + RightInset(); max.height += TopInset() + BottomInset();