From 15e334974b283a0bd2dcf487d312c5227556dd5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 23 Jan 2007 17:27:32 +0000 Subject: [PATCH] Calling ResizeToPreferred() on a BBox now honours its current size, IOW it won't get any smaller due to this (before, a box without a label would resize itself to 0/0). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19919 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Box.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/Box.cpp b/src/kits/interface/Box.cpp index 899e3dad58..d091e193d4 100644 --- a/src/kits/interface/Box.cpp +++ b/src/kits/interface/Box.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2006, Haiku, Inc. + * Copyright (c) 2001-2007, Haiku, Inc. * Distributed under the terms of the MIT license. * * Authors: @@ -360,7 +360,16 @@ BBox::ResolveSpecifier(BMessage *message, int32 index, void BBox::ResizeToPreferred() { - BView::ResizeToPreferred(); + float width, height; + GetPreferredSize(&width, &height); + + // make sure the box don't get smaller than it already is + if (width < Bounds().Width()) + width = Bounds().Width(); + if (height < Bounds().Height()) + height = Bounds().Height(); + + BView::ResizeTo(width, height); }