The layout on the BTabView already knows the correct necessary size, because
the insets for the border and tab height have already been applied. The old implementation for the BSize methods did not take border width into account. It fixes tabviews being layouted too small. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35887 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
2db604ae36
commit
7b19a569be
@ -1053,11 +1053,7 @@ BTabView::GetPreferredSize(float *width, float *height)
|
||||
BSize
|
||||
BTabView::MinSize()
|
||||
{
|
||||
BSize size(_TabsMinSize());
|
||||
BSize containerSize = fContainerView->MinSize();
|
||||
if (containerSize.width > size.width)
|
||||
size.width = containerSize.width;
|
||||
size.height += containerSize.height;
|
||||
BSize size = GetLayout()->MinSize();
|
||||
return BLayoutUtils::ComposeSize(ExplicitMinSize(), size);
|
||||
}
|
||||
|
||||
@ -1065,11 +1061,7 @@ BTabView::MinSize()
|
||||
BSize
|
||||
BTabView::MaxSize()
|
||||
{
|
||||
BSize size(_TabsMinSize());
|
||||
BSize containerSize = fContainerView->MaxSize();
|
||||
if (containerSize.width > size.width)
|
||||
size.width = containerSize.width;
|
||||
size.height += containerSize.height;
|
||||
BSize size = GetLayout()->MaxSize();
|
||||
return BLayoutUtils::ComposeSize(ExplicitMaxSize(), size);
|
||||
}
|
||||
|
||||
@ -1077,11 +1069,7 @@ BTabView::MaxSize()
|
||||
BSize
|
||||
BTabView::PreferredSize()
|
||||
{
|
||||
BSize size(_TabsMinSize());
|
||||
BSize containerSize = fContainerView->PreferredSize();
|
||||
if (containerSize.width > size.width)
|
||||
size.width = containerSize.width;
|
||||
size.height += containerSize.height;
|
||||
BSize size = GetLayout()->PreferredSize();
|
||||
return BLayoutUtils::ComposeSize(ExplicitPreferredSize(), size);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user