BBox: fix minimal size when using layouted mode.
It is possible to set a custom layout on a BBox, which is then applied to the children excluding the label. However, the label size must still be used when computing the minimal size of the BBox in that case.
This commit is contained in:
@@ -516,6 +516,8 @@ BBox::MinSize()
|
|||||||
_ValidateLayoutData();
|
_ValidateLayoutData();
|
||||||
|
|
||||||
BSize size = (GetLayout() ? GetLayout()->MinSize() : fLayoutData->min);
|
BSize size = (GetLayout() ? GetLayout()->MinSize() : fLayoutData->min);
|
||||||
|
if (size.width < fLayoutData->min.width)
|
||||||
|
size.width = fLayoutData->min.width;
|
||||||
return BLayoutUtils::ComposeSize(ExplicitMinSize(), size);
|
return BLayoutUtils::ComposeSize(ExplicitMinSize(), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -583,8 +585,7 @@ BBox::DoLayout()
|
|||||||
// don't trigger a relayout
|
// don't trigger a relayout
|
||||||
AddChild(fLabelView, ChildAt(0));
|
AddChild(fLabelView, ChildAt(0));
|
||||||
EnableLayoutInvalidation();
|
EnableLayoutInvalidation();
|
||||||
} else
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_ValidateLayoutData();
|
_ValidateLayoutData();
|
||||||
@@ -828,9 +829,8 @@ BBox::_ValidateLayoutData()
|
|||||||
BSize size = fLabelView->PreferredSize();
|
BSize size = fLabelView->PreferredSize();
|
||||||
fLayoutData->label_box.Set(10, 0, 10 + size.width, size.height);
|
fLayoutData->label_box.Set(10, 0, 10 + size.width, size.height);
|
||||||
labelHeight = size.height + 1;
|
labelHeight = size.height + 1;
|
||||||
} else {
|
} else
|
||||||
label = false;
|
label = false;
|
||||||
}
|
|
||||||
|
|
||||||
// border
|
// border
|
||||||
switch (fStyle) {
|
switch (fStyle) {
|
||||||
|
|||||||
Reference in New Issue
Block a user