Author: axeld Date: 2010-11-15 19:31:21 +0100 (Mon, 15 Nov 2010) New Revision: 39437 Changeset: http://dev.haiku-os.org/changeset/39437 Modified: haiku/trunk/src/add-ons/decorators/SATDecorator/SATWindow.cpp Log: * Fixed build. * Minor cleanup. Modified: haiku/trunk/src/add-ons/decorators/SATDecorator/SATWindow.cpp =================================================================== --- haiku/trunk/src/add-ons/decorators/SATDecorator/SATWindow.cpp 2010-11-15 17:44:18 UTC (rev 39436) +++ haiku/trunk/src/add-ons/decorators/SATDecorator/SATWindow.cpp 2010-11-15 18:31:21 UTC (rev 39437) @@ -19,6 +19,9 @@ using namespace BPrivate; +const uint32 kExtentPenalty = 10; + + GroupCookie::GroupCookie(SATWindow* satWindow) : fSATWindow(satWindow), @@ -42,7 +45,6 @@ fWidthConstraint(NULL), fHeightConstraint(NULL) { - } @@ -52,9 +54,6 @@ } -const uint32 kExtentPenalty = 10; - - void GroupCookie::DoGroupLayout(SATWindow* triggerWindow) { @@ -66,7 +65,7 @@ // adjust window size soft constraints fWidthConstraint->SetRightSide(frame.Width()); fHeightConstraint->SetRightSide(frame.Height()); - + // adjust window position soft constraints // (a bit more penalty for them so they take precedence) fLeftConstraint->SetRightSide(frame.left); @@ -218,7 +217,7 @@ fTopBorder = NULL; fRightBorder = NULL; fBottomBorder = NULL; - + delete fLeftBorderConstraint; delete fTopBorderConstraint; delete fRightBorderConstraint; @@ -274,6 +273,9 @@ } +// #pragma mark - + + SATWindow::SATWindow(StackAndTile* sat, Window* window) : fWindow(window), @@ -539,7 +541,7 @@ frame.left -= decorator->BorderWidth(); frame.right += decorator->BorderWidth() + 1; frame.top -= decorator->BorderWidth() + decorator->TabHeight() + 1; - frame.bottom += decorator->BorderWidth(); + frame.bottom += decorator->BorderWidth(); return frame; } @@ -552,12 +554,15 @@ fWindow->GetSizeLimits(minWidth, maxWidth, minHeight, maxHeight); SATDecorator* decorator = GetDecorator(); - if (!decorator) + if (decorator == NULL) return; - *minWidth += 2 * decorator->BorderWidth() + 1; - *minHeight += 2 * decorator->BorderWidth() + decorator->TabHeight() + 1; - *maxWidth += 2 * decorator->BorderWidth() + 1; - *maxHeight += 2 * decorator->BorderWidth() + decorator->TabHeight() + 1; + + *minWidth += 2 * (int32)decorator->BorderWidth() + 1; + *minHeight += 2 * (int32)decorator->BorderWidth() + + (int32)decorator->TabHeight() + 1; + *maxWidth += 2 * (int32)decorator->BorderWidth() + 1; + *maxHeight += 2 * (int32)decorator->BorderWidth() + + (int32)decorator->TabHeight() + 1; } @@ -723,17 +728,18 @@ &maxDecorWidth, &maxDecorHeight); BRect frame = fWindow->Frame(); if (fOriginalMinWidth <= minDecorWidth) - minWidth = frame.Width(); + minWidth = frame.IntegerWidth(); if (fOriginalMinHeight <= minDecorHeight) - minHeight = frame.Height(); + minHeight = frame.IntegerHeight(); } fWindow->SetSizeLimits(minWidth, B_SIZE_UNLIMITED, minHeight, B_SIZE_UNLIMITED); - + if (decorator) { - minWidth += 2 * decorator->BorderWidth(); - minHeight += 2 * decorator->BorderWidth() + decorator->TabHeight() + 1; + minWidth += 2 * (int32)decorator->BorderWidth(); + minHeight += 2 * (int32)decorator->BorderWidth() + + (int32)decorator->TabHeight() + 1; } fGroupCookie->SetSizeLimits(minWidth, B_SIZE_UNLIMITED, minHeight, B_SIZE_UNLIMITED);