// ComposeSize BSize BLayoutUtils::ComposeSize(BSize size, BSize layoutSize) { if (!size.IsWidthSet()) size.width = layoutSize.width; if (!size.IsHeightSet()) size.height = layoutSize.height; return size; }
// SetExplicitMaxSize void BSpaceLayoutItem::SetExplicitMaxSize(BSize size) { if (size.IsWidthSet()) fMaxSize.width = size.width; if (size.IsHeightSet()) fMaxSize.height = size.height; InvalidateLayout(); }
BSize ExtensionListView::MinSize() { if (!fMinSize.IsWidthSet()) { BFont font; GetFont(&font); fMinSize.width = font.StringWidth(".mmmmm"); font_height height; font.GetHeight(&height); fMinSize.height = (height.ascent + height.descent + height.leading) * 3; } return fMinSize; }