Author: czeidler Date: 2010-07-18 03:35:45 +0200 (Sun, 18 Jul 2010) New Revision: 37559 Changeset: http://dev.haiku-os.org/changeset/37559 Ticket: http://dev.haiku-os.org/ticket/6321 Modified: haiku/trunk/src/servers/app/Decorator.cpp haiku/trunk/src/servers/app/Decorator.h haiku/trunk/src/servers/app/DefaultDecorator.cpp haiku/trunk/src/servers/app/DefaultDecorator.h Log: Fix SetTitle (bug #6321). Modified: haiku/trunk/src/servers/app/Decorator.cpp =================================================================== --- haiku/trunk/src/servers/app/Decorator.cpp 2010-07-18 00:56:52 UTC (rev 37558) +++ haiku/trunk/src/servers/app/Decorator.cpp 2010-07-18 01:35:45 UTC (rev 37559) @@ -187,12 +187,10 @@ void Decorator::SetTitle(const char* string, BRegion* updateRegion) { - fTitle.SetTo(string); - _DoLayout(); - fFootprintValid = false; // the border very likely changed + fTitle.SetTo(string); _SetTitle(string, updateRegion); // TODO: redraw? @@ -640,12 +638,6 @@ void -Decorator::_SetTitle(const char* string, BRegion* updateRegion) -{ -} - - -void Decorator::_MoveBy(BPoint offset) { fZoomRect.OffsetBy(offset); Modified: haiku/trunk/src/servers/app/Decorator.h =================================================================== --- haiku/trunk/src/servers/app/Decorator.h 2010-07-18 00:56:52 UTC (rev 37558) +++ haiku/trunk/src/servers/app/Decorator.h 2010-07-18 01:35:45 UTC (rev 37559) @@ -144,7 +144,7 @@ BRegion* updateRegion = NULL); virtual void _SetTitle(const char* string, - BRegion* updateRegion = NULL); + BRegion* updateRegion = NULL) = 0; virtual void _SetFocus(); virtual void _MoveBy(BPoint offset); Modified: haiku/trunk/src/servers/app/DefaultDecorator.cpp =================================================================== --- haiku/trunk/src/servers/app/DefaultDecorator.cpp 2010-07-18 00:56:52 UTC (rev 37558) +++ haiku/trunk/src/servers/app/DefaultDecorator.cpp 2010-07-18 01:35:45 UTC (rev 37559) @@ -120,31 +120,6 @@ } -void -DefaultDecorator::SetTitle(const char* string, BRegion* updateRegion) -{ - // TODO: we could be much smarter about the update region - - BRect rect = TabRect(); - - Decorator::SetTitle(string); - - 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.bottom++; - // the border will look differently when the title is adjacent - - updateRegion->Include(rect); -} - - bool DefaultDecorator::GetSettings(BMessage* settings) const { @@ -768,6 +743,31 @@ void +DefaultDecorator::_SetTitle(const char* string, BRegion* updateRegion) +{ + // TODO: we could be much smarter about the update region + + BRect rect = TabRect(); + + _DoLayout(); + + 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.bottom++; + // the border will look differently when the title is adjacent + + updateRegion->Include(rect); +} + + +void DefaultDecorator::_FontsChanged(DesktopSettings& settings, BRegion* updateRegion) { Modified: haiku/trunk/src/servers/app/DefaultDecorator.h =================================================================== --- haiku/trunk/src/servers/app/DefaultDecorator.h 2010-07-18 00:56:52 UTC (rev 37558) +++ haiku/trunk/src/servers/app/DefaultDecorator.h 2010-07-18 01:35:45 UTC (rev 37559) @@ -27,9 +27,6 @@ uint32 flags); virtual ~DefaultDecorator(); - virtual void SetTitle(const char* string, - BRegion* updateRegion = NULL); - virtual float TabLocation() const { return (float)fTabOffset; } @@ -54,6 +51,9 @@ virtual void _DrawTitle(BRect r); virtual void _DrawZoom(BRect r); + virtual void _SetTitle(const char* string, + BRegion* updateRegion = NULL); + virtual void _FontsChanged(DesktopSettings& settings, BRegion* updateRegion); virtual void _SetLook(DesktopSettings& settings,