From 7b19a569beec417494b31fc8c9e6e7c67810afae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 17 Mar 2010 12:10:05 +0000 Subject: [PATCH] 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 --- src/kits/interface/TabView.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/kits/interface/TabView.cpp b/src/kits/interface/TabView.cpp index d50441104b..f919442160 100644 --- a/src/kits/interface/TabView.cpp +++ b/src/kits/interface/TabView.cpp @@ -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); }