* Fixed build.

* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39437 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2010-11-15 18:31:21 +00:00
parent 495e073b20
commit 55a54abc90
@@ -19,6 +19,9 @@
using namespace BPrivate; using namespace BPrivate;
const uint32 kExtentPenalty = 10;
GroupCookie::GroupCookie(SATWindow* satWindow) GroupCookie::GroupCookie(SATWindow* satWindow)
: :
fSATWindow(satWindow), fSATWindow(satWindow),
@@ -42,7 +45,6 @@ GroupCookie::GroupCookie(SATWindow* satWindow)
fWidthConstraint(NULL), fWidthConstraint(NULL),
fHeightConstraint(NULL) fHeightConstraint(NULL)
{ {
} }
@@ -52,9 +54,6 @@ GroupCookie::~GroupCookie()
} }
const uint32 kExtentPenalty = 10;
void void
GroupCookie::DoGroupLayout(SATWindow* triggerWindow) GroupCookie::DoGroupLayout(SATWindow* triggerWindow)
{ {
@@ -66,7 +65,7 @@ GroupCookie::DoGroupLayout(SATWindow* triggerWindow)
// adjust window size soft constraints // adjust window size soft constraints
fWidthConstraint->SetRightSide(frame.Width()); fWidthConstraint->SetRightSide(frame.Width());
fHeightConstraint->SetRightSide(frame.Height()); fHeightConstraint->SetRightSide(frame.Height());
// adjust window position soft constraints // adjust window position soft constraints
// (a bit more penalty for them so they take precedence) // (a bit more penalty for them so they take precedence)
fLeftConstraint->SetRightSide(frame.left); fLeftConstraint->SetRightSide(frame.left);
@@ -218,7 +217,7 @@ GroupCookie::Uninit()
fTopBorder = NULL; fTopBorder = NULL;
fRightBorder = NULL; fRightBorder = NULL;
fBottomBorder = NULL; fBottomBorder = NULL;
delete fLeftBorderConstraint; delete fLeftBorderConstraint;
delete fTopBorderConstraint; delete fTopBorderConstraint;
delete fRightBorderConstraint; delete fRightBorderConstraint;
@@ -274,6 +273,9 @@ GroupCookie::_UpdateWindowSize(const BRect& frame)
} }
// #pragma mark -
SATWindow::SATWindow(StackAndTile* sat, Window* window) SATWindow::SATWindow(StackAndTile* sat, Window* window)
: :
fWindow(window), fWindow(window),
@@ -539,7 +541,7 @@ SATWindow::CompleteWindowFrame()
frame.left -= decorator->BorderWidth(); frame.left -= decorator->BorderWidth();
frame.right += decorator->BorderWidth() + 1; frame.right += decorator->BorderWidth() + 1;
frame.top -= decorator->BorderWidth() + decorator->TabHeight() + 1; frame.top -= decorator->BorderWidth() + decorator->TabHeight() + 1;
frame.bottom += decorator->BorderWidth(); frame.bottom += decorator->BorderWidth();
return frame; return frame;
} }
@@ -552,12 +554,15 @@ SATWindow::GetSizeLimits(int32* minWidth, int32* maxWidth, int32* minHeight,
fWindow->GetSizeLimits(minWidth, maxWidth, minHeight, maxHeight); fWindow->GetSizeLimits(minWidth, maxWidth, minHeight, maxHeight);
SATDecorator* decorator = GetDecorator(); SATDecorator* decorator = GetDecorator();
if (!decorator) if (decorator == NULL)
return; return;
*minWidth += 2 * decorator->BorderWidth() + 1;
*minHeight += 2 * decorator->BorderWidth() + decorator->TabHeight() + 1; *minWidth += 2 * (int32)decorator->BorderWidth() + 1;
*maxWidth += 2 * decorator->BorderWidth() + 1; *minHeight += 2 * (int32)decorator->BorderWidth()
*maxHeight += 2 * decorator->BorderWidth() + decorator->TabHeight() + 1; + (int32)decorator->TabHeight() + 1;
*maxWidth += 2 * (int32)decorator->BorderWidth() + 1;
*maxHeight += 2 * (int32)decorator->BorderWidth()
+ (int32)decorator->TabHeight() + 1;
} }
@@ -723,17 +728,18 @@ SATWindow::_UpdateSizeLimits()
&maxDecorWidth, &maxDecorHeight); &maxDecorWidth, &maxDecorHeight);
BRect frame = fWindow->Frame(); BRect frame = fWindow->Frame();
if (fOriginalMinWidth <= minDecorWidth) if (fOriginalMinWidth <= minDecorWidth)
minWidth = frame.Width(); minWidth = frame.IntegerWidth();
if (fOriginalMinHeight <= minDecorHeight) if (fOriginalMinHeight <= minDecorHeight)
minHeight = frame.Height(); minHeight = frame.IntegerHeight();
} }
fWindow->SetSizeLimits(minWidth, B_SIZE_UNLIMITED, fWindow->SetSizeLimits(minWidth, B_SIZE_UNLIMITED,
minHeight, B_SIZE_UNLIMITED); minHeight, B_SIZE_UNLIMITED);
if (decorator) { if (decorator) {
minWidth += 2 * decorator->BorderWidth(); minWidth += 2 * (int32)decorator->BorderWidth();
minHeight += 2 * decorator->BorderWidth() + decorator->TabHeight() + 1; minHeight += 2 * (int32)decorator->BorderWidth()
+ (int32)decorator->TabHeight() + 1;
} }
fGroupCookie->SetSizeLimits(minWidth, B_SIZE_UNLIMITED, minHeight, fGroupCookie->SetSizeLimits(minWidth, B_SIZE_UNLIMITED, minHeight,
B_SIZE_UNLIMITED); B_SIZE_UNLIMITED);