Make BALMLayout respect its position when nested.
This commit is contained in:
@@ -106,7 +106,7 @@ private:
|
|||||||
Row* row, Column* column,
|
Row* row, Column* column,
|
||||||
RowColumnManager* manager);
|
RowColumnManager* manager);
|
||||||
|
|
||||||
void _DoLayout();
|
void _DoLayout(const BPoint& offset);
|
||||||
|
|
||||||
void _UpdateMinSizeConstraint(BSize min);
|
void _UpdateMinSizeConstraint(BSize min);
|
||||||
void _UpdateMaxSizeConstraint(BSize max);
|
void _UpdateMaxSizeConstraint(BSize max);
|
||||||
|
|||||||
@@ -794,14 +794,15 @@ BALMLayout::DoLayout()
|
|||||||
|
|
||||||
// Enforced absolute positions of Right and Bottom
|
// Enforced absolute positions of Right and Bottom
|
||||||
BRect area(LayoutArea());
|
BRect area(LayoutArea());
|
||||||
Right()->SetRange(area.right, area.right);
|
BSize size(area.Size());
|
||||||
Bottom()->SetRange(area.bottom, area.bottom);
|
Right()->SetRange(size.width, size.width);
|
||||||
|
Bottom()->SetRange(size.height, size.height);
|
||||||
|
|
||||||
_TrySolve();
|
_TrySolve();
|
||||||
|
|
||||||
// set the calculated positions and sizes for every area
|
// set the calculated positions and sizes for every area
|
||||||
for (int32 i = 0; i < CountItems(); i++)
|
for (int32 i = 0; i < CountItems(); i++)
|
||||||
AreaFor(ItemAt(i))->_DoLayout();
|
AreaFor(ItemAt(i))->_DoLayout(area.LeftTop());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -565,7 +565,7 @@ Area::_Init(LinearSpec* ls, Row* row, Column* column, RowColumnManager* manager)
|
|||||||
* Perform layout on the area.
|
* Perform layout on the area.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
Area::_DoLayout()
|
Area::_DoLayout(const BPoint& offset)
|
||||||
{
|
{
|
||||||
// check if if we are initialized
|
// check if if we are initialized
|
||||||
if (!fLeft)
|
if (!fLeft)
|
||||||
@@ -577,7 +577,7 @@ Area::_DoLayout()
|
|||||||
areaFrame.top += TopInset();
|
areaFrame.top += TopInset();
|
||||||
areaFrame.bottom -= BottomInset();
|
areaFrame.bottom -= BottomInset();
|
||||||
|
|
||||||
fLayoutItem->AlignInFrame(areaFrame);
|
fLayoutItem->AlignInFrame(areaFrame.OffsetBySelf(offset));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user