Just realized that BTabViews don't have a BLayout set when not layouted. But
just in case someone calls the BSize methods on such a tab view, provide a fall back implementation. This one should now also report the correct size, only less efficient. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35888 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1053,7 +1053,18 @@ BTabView::GetPreferredSize(float *width, float *height)
|
|||||||
BSize
|
BSize
|
||||||
BTabView::MinSize()
|
BTabView::MinSize()
|
||||||
{
|
{
|
||||||
BSize size = GetLayout()->MinSize();
|
BSize size;
|
||||||
|
if (GetLayout())
|
||||||
|
size = GetLayout()->MinSize();
|
||||||
|
else {
|
||||||
|
size = _TabsMinSize();
|
||||||
|
BSize containerSize = fContainerView->MinSize();
|
||||||
|
containerSize.width += 2 * _BorderWidth();
|
||||||
|
containerSize.height += _BorderWidth();
|
||||||
|
if (containerSize.width > size.width)
|
||||||
|
size.width = containerSize.width;
|
||||||
|
size.height += containerSize.height;
|
||||||
|
}
|
||||||
return BLayoutUtils::ComposeSize(ExplicitMinSize(), size);
|
return BLayoutUtils::ComposeSize(ExplicitMinSize(), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1061,7 +1072,18 @@ BTabView::MinSize()
|
|||||||
BSize
|
BSize
|
||||||
BTabView::MaxSize()
|
BTabView::MaxSize()
|
||||||
{
|
{
|
||||||
BSize size = GetLayout()->MaxSize();
|
BSize size;
|
||||||
|
if (GetLayout())
|
||||||
|
size = GetLayout()->MaxSize();
|
||||||
|
else {
|
||||||
|
size = _TabsMinSize();
|
||||||
|
BSize containerSize = fContainerView->MaxSize();
|
||||||
|
containerSize.width += 2 * _BorderWidth();
|
||||||
|
containerSize.height += _BorderWidth();
|
||||||
|
if (containerSize.width > size.width)
|
||||||
|
size.width = containerSize.width;
|
||||||
|
size.height += containerSize.height;
|
||||||
|
}
|
||||||
return BLayoutUtils::ComposeSize(ExplicitMaxSize(), size);
|
return BLayoutUtils::ComposeSize(ExplicitMaxSize(), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1069,7 +1091,18 @@ BTabView::MaxSize()
|
|||||||
BSize
|
BSize
|
||||||
BTabView::PreferredSize()
|
BTabView::PreferredSize()
|
||||||
{
|
{
|
||||||
BSize size = GetLayout()->PreferredSize();
|
BSize size;
|
||||||
|
if (GetLayout())
|
||||||
|
size = GetLayout()->PreferredSize();
|
||||||
|
else {
|
||||||
|
size = _TabsMinSize();
|
||||||
|
BSize containerSize = fContainerView->PreferredSize();
|
||||||
|
containerSize.width += 2 * _BorderWidth();
|
||||||
|
containerSize.height += _BorderWidth();
|
||||||
|
if (containerSize.width > size.width)
|
||||||
|
size.width = containerSize.width;
|
||||||
|
size.height += containerSize.height;
|
||||||
|
}
|
||||||
return BLayoutUtils::ComposeSize(ExplicitPreferredSize(), size);
|
return BLayoutUtils::ComposeSize(ExplicitPreferredSize(), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user