Author: pulkomandy Date: 2010-07-20 12:47:11 +0200 (Tue, 20 Jul 2010) New Revision: 37615 Changeset: http://dev.haiku-os.org/changeset/37615 Modified: haiku/trunk/src/add-ons/decorators/BeDecorator/BeDecorator.cpp haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.cpp Log: * BeDecorator : use _InvalidateFootprint as in the default decorator. * MacDecorator : use _InvalidateFootprint and implement _MoveBy. This makes the MacDecorator work fine again. Modified: haiku/trunk/src/add-ons/decorators/BeDecorator/BeDecorator.cpp =================================================================== --- haiku/trunk/src/add-ons/decorators/BeDecorator/BeDecorator.cpp 2010-07-20 08:44:30 UTC (rev 37614) +++ haiku/trunk/src/add-ons/decorators/BeDecorator/BeDecorator.cpp 2010-07-20 10:47:11 UTC (rev 37615) @@ -13,6 +13,8 @@ #include "BeDecorator.h" +#include <stdio.h> + #include "DesktopSettings.h" #include "DrawingEngine.h" #include "DrawState.h" @@ -28,7 +30,6 @@ //#define DEBUG_DECORATOR #ifdef DEBUG_DECORATOR -# include <stdio.h> # define STRACE(x) printf x #else # define STRACE(x) ; @@ -114,7 +115,7 @@ // resize itself! STRACE(("BeDecorator:\n")); - STRACE(("\tFrame(%.1f,%.1f,%.1f,%.1f)\n", + STRACE(("\tFrame (%.1f,%.1f,%.1f,%.1f)\n", rect.left, rect.top, rect.right, rect.bottom)); } @@ -754,11 +755,7 @@ if (updateRegion == NULL) return; - BRect updatedRect = TabRect(); - if (rect.left > updatedRect.left) - rect.left = updatedRect.left; - if (rect.right < updatedRect.right) - rect.right = updatedRect.right; + rect = rect | TabRect(); rect.bottom++; // the border will look differently when the title is adjacent @@ -778,6 +775,7 @@ _UpdateFont(settings); _DoLayout(); + _InvalidateFootprint(); if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); } @@ -793,10 +791,12 @@ if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); + fLook = look; + _UpdateFont(settings); - _DoLayout(); + _InvalidateFootprint(); if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); } @@ -811,8 +811,10 @@ if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); + fFlags = flags; _DoLayout(); + _InvalidateFootprint(); if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); } Modified: haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.cpp =================================================================== --- haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.cpp 2010-07-20 08:44:30 UTC (rev 37614) +++ haiku/trunk/src/add-ons/decorators/MacDecorator/MacDecorator.cpp 2010-07-20 10:47:11 UTC (rev 37615) @@ -9,6 +9,8 @@ #include "MacDecorator.h" +#include <stdio.h> + #include <GradientLinear.h> #include <Point.h> #include <View.h> @@ -21,8 +23,7 @@ //#define DEBUG_DECORATOR #ifdef DEBUG_DECORATOR -# include <stdio.h> -# define STRACE(x) printf x ; +# define STRACE(x) printf x #else # define STRACE(x) ; #endif @@ -134,8 +135,10 @@ void MacDecorator::_DoLayout() { - int32 kDefaultBorderWidth = 6; + const int32 kDefaultBorderWidth = 6; STRACE(("MacDecorator: Do Layout\n")); + // Here we determine the size of every rectangle that we use + // internally when we are given the size of the client rectangle. bool hasTab = false; @@ -162,10 +165,10 @@ fBorderWidth = 0; } fBorderRect=fFrame; + fBorderRect.InsetBy(-fBorderWidth, -fBorderWidth); // calculate our tab rect if (hasTab) { - fBorderRect.InsetBy(-kDefaultBorderWidth, -kDefaultBorderWidth); fBorderRect.top +=3; font_height fontHeight; @@ -645,6 +648,7 @@ _UpdateFont(settings); _DoLayout(); + _InvalidateFootprint(); if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); } @@ -665,6 +669,7 @@ _UpdateFont(settings); _DoLayout(); + _InvalidateFootprint(); if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); } @@ -681,6 +686,7 @@ _DoLayout(); + _InvalidateFootprint(); if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); } @@ -699,7 +705,12 @@ void MacDecorator::_MoveBy(BPoint offset) { - // TODO ? + fFrame.OffsetBy(offset); + fCloseRect.OffsetBy(offset); + fTabRect.OffsetBy(offset); + fResizeRect.OffsetBy(offset); + fZoomRect.OffsetBy(offset); + fBorderRect.OffsetBy(offset); }