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
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001-2006, Haiku, Inc.
|
* Copyright (c) 2001-2007, Haiku, Inc.
|
||||||
* Distributed under the terms of the MIT license.
|
* Distributed under the terms of the MIT license.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -360,7 +360,16 @@ BBox::ResolveSpecifier(BMessage *message, int32 index,
|
|||||||
void
|
void
|
||||||
BBox::ResizeToPreferred()
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user