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.
This commit is contained in:
@@ -571,6 +571,9 @@ Area::_DoLayout(const BPoint& offset)
|
|||||||
if (!fLeft)
|
if (!fLeft)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!fLayoutItem->IsVisible())
|
||||||
|
fLayoutItem->AlignInFrame(BRect(0, 0, -1, -1));
|
||||||
|
|
||||||
BRect areaFrame(Frame());
|
BRect areaFrame(Frame());
|
||||||
areaFrame.left += LeftInset();
|
areaFrame.left += LeftInset();
|
||||||
areaFrame.right -= RightInset();
|
areaFrame.right -= RightInset();
|
||||||
@@ -584,6 +587,12 @@ Area::_DoLayout(const BPoint& offset)
|
|||||||
void
|
void
|
||||||
Area::_UpdateMinSizeConstraint(BSize min)
|
Area::_UpdateMinSizeConstraint(BSize min)
|
||||||
{
|
{
|
||||||
|
if (!fLayoutItem->IsVisible()) {
|
||||||
|
fMinContentHeight->SetRightSide(-1);
|
||||||
|
fMinContentWidth->SetRightSide(-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
float width = 0.;
|
float width = 0.;
|
||||||
float height = 0.;
|
float height = 0.;
|
||||||
if (min.width > 0)
|
if (min.width > 0)
|
||||||
@@ -599,6 +608,12 @@ Area::_UpdateMinSizeConstraint(BSize min)
|
|||||||
void
|
void
|
||||||
Area::_UpdateMaxSizeConstraint(BSize max)
|
Area::_UpdateMaxSizeConstraint(BSize max)
|
||||||
{
|
{
|
||||||
|
if (!fLayoutItem->IsVisible()) {
|
||||||
|
fMaxContentHeight->SetRightSide(B_SIZE_UNLIMITED);
|
||||||
|
fMaxContentWidth->SetRightSide(B_SIZE_UNLIMITED);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
max.width += LeftInset() + RightInset();
|
max.width += LeftInset() + RightInset();
|
||||||
max.height += TopInset() + BottomInset();
|
max.height += TopInset() + BottomInset();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user