diff --git a/src/add-ons/decorators/BeDecorator/BeDecorator.cpp b/src/add-ons/decorators/BeDecorator/BeDecorator.cpp index 9eb96c0d28..f3beba897c 100644 --- a/src/add-ons/decorators/BeDecorator/BeDecorator.cpp +++ b/src/add-ons/decorators/BeDecorator/BeDecorator.cpp @@ -13,6 +13,8 @@ #include "BeDecorator.h" +#include + #include "DesktopSettings.h" #include "DrawingEngine.h" #include "DrawState.h" @@ -28,7 +30,6 @@ //#define DEBUG_DECORATOR #ifdef DEBUG_DECORATOR -# include # define STRACE(x) printf x #else # define STRACE(x) ; @@ -114,7 +115,7 @@ BeDecorator::BeDecorator(DesktopSettings& settings, BRect rect, // 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 @@ BeDecorator::_SetTitle(const char* string, BRegion* updateRegion) 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 @@ BeDecorator::_FontsChanged(DesktopSettings& settings, _UpdateFont(settings); _DoLayout(); + _InvalidateFootprint(); if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); } @@ -793,10 +791,12 @@ BeDecorator::_SetLook(DesktopSettings& settings, window_look look, if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); - _UpdateFont(settings); + fLook = look; + _UpdateFont(settings); _DoLayout(); + _InvalidateFootprint(); if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); } @@ -811,8 +811,10 @@ BeDecorator::_SetFlags(uint32 flags, BRegion* updateRegion) if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); + fFlags = flags; _DoLayout(); + _InvalidateFootprint(); if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); } diff --git a/src/add-ons/decorators/MacDecorator/MacDecorator.cpp b/src/add-ons/decorators/MacDecorator/MacDecorator.cpp index 7b0e6f72a0..1b3a6b437a 100644 --- a/src/add-ons/decorators/MacDecorator/MacDecorator.cpp +++ b/src/add-ons/decorators/MacDecorator/MacDecorator.cpp @@ -9,6 +9,8 @@ #include "MacDecorator.h" +#include + #include #include #include @@ -21,8 +23,7 @@ //#define DEBUG_DECORATOR #ifdef DEBUG_DECORATOR -# include -# define STRACE(x) printf x ; +# define STRACE(x) printf x #else # define STRACE(x) ; #endif @@ -134,8 +135,10 @@ MacDecorator::Clicked(BPoint point, int32 buttons, int32 modifiers) 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 @@ MacDecorator::_DoLayout() 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 @@ MacDecorator::_FontsChanged(DesktopSettings& settings, _UpdateFont(settings); _DoLayout(); + _InvalidateFootprint(); if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); } @@ -665,6 +669,7 @@ MacDecorator::_SetLook(DesktopSettings& settings, window_look look, _UpdateFont(settings); _DoLayout(); + _InvalidateFootprint(); if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); } @@ -681,6 +686,7 @@ MacDecorator::_SetFlags(uint32 flags, BRegion* updateRegion) _DoLayout(); + _InvalidateFootprint(); if (updateRegion != NULL) updateRegion->Include(&GetFootprint()); } @@ -699,7 +705,12 @@ MacDecorator::_SetColors() void MacDecorator::_MoveBy(BPoint offset) { - // TODO ? + fFrame.OffsetBy(offset); + fCloseRect.OffsetBy(offset); + fTabRect.OffsetBy(offset); + fResizeRect.OffsetBy(offset); + fZoomRect.OffsetBy(offset); + fBorderRect.OffsetBy(offset); }