From 7c1cb28850250bccabab35f4e3951fcd808b4416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 4 Aug 2007 11:18:21 +0000 Subject: [PATCH] * cache the tab highlight and shadow color git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21819 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/DefaultDecorator.cpp | 19 +++++++++---------- src/servers/app/DefaultDecorator.h | 4 +++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/servers/app/DefaultDecorator.cpp b/src/servers/app/DefaultDecorator.cpp index 5b8e28d1c4..064a927314 100644 --- a/src/servers/app/DefaultDecorator.cpp +++ b/src/servers/app/DefaultDecorator.cpp @@ -905,12 +905,6 @@ DefaultDecorator::_DrawTab(BRect invalid) if (!fTabRect.IsValid() || !invalid.Intersects(fTabRect)) return; - // TODO: cache these - RGBColor tabColorLight = RGBColor(tint_color(fTabColor.GetColor32(), - (B_LIGHTEN_2_TINT + B_LIGHTEN_MAX_TINT) / 2)); - RGBColor tabColorShadow = RGBColor(tint_color(fTabColor.GetColor32(), - B_DARKEN_2_TINT)); - // outer frame fDrawingEngine->StrokeLine(fTabRect.LeftTop(), fTabRect.LeftBottom(), fFrameColors[0]); fDrawingEngine->StrokeLine(fTabRect.LeftTop(), fTabRect.RightTop(), fFrameColors[0]); @@ -922,17 +916,17 @@ DefaultDecorator::_DrawTab(BRect invalid) // bevel fDrawingEngine->StrokeLine(BPoint(fTabRect.left + 1, fTabRect.top + 1), BPoint(fTabRect.left + 1, fTabRect.bottom - (fLook == kLeftTitledWindowLook ? 1 : 0)), - tabColorLight); + fTabColorLight); fDrawingEngine->StrokeLine(BPoint(fTabRect.left + 1, fTabRect.top + 1), BPoint(fTabRect.right - (fLook == kLeftTitledWindowLook ? 0 : 1), fTabRect.top + 1), - tabColorLight); + fTabColorLight); if (fLook != kLeftTitledWindowLook) { fDrawingEngine->StrokeLine(BPoint(fTabRect.right - 1, fTabRect.top + 2), - BPoint(fTabRect.right - 1, fTabRect.bottom), tabColorShadow); + BPoint(fTabRect.right - 1, fTabRect.bottom), fTabColorShadow); } else { fDrawingEngine->StrokeLine(BPoint(fTabRect.left + 2, fTabRect.bottom - 1), - BPoint(fTabRect.right, fTabRect.bottom - 1), tabColorShadow); + BPoint(fTabRect.right, fTabRect.bottom - 1), fTabColorShadow); } // fill @@ -1045,6 +1039,11 @@ DefaultDecorator::_SetFocus() // fFrameColors[4].SetColor(152, 152, 152); // fFrameColors[5].SetColor(96, 96, 96); } + + fTabColorLight = RGBColor(tint_color(fTabColor.GetColor32(), + (B_LIGHTEN_2_TINT + B_LIGHTEN_MAX_TINT) / 2)); + fTabColorShadow = RGBColor(tint_color(fTabColor.GetColor32(), + B_DARKEN_2_TINT)); } // _SetColors diff --git a/src/servers/app/DefaultDecorator.h b/src/servers/app/DefaultDecorator.h index 594564d0ad..011afb3fd1 100644 --- a/src/servers/app/DefaultDecorator.h +++ b/src/servers/app/DefaultDecorator.h @@ -81,7 +81,9 @@ class DefaultDecorator: public Decorator { RGBColor fButtonLowColor; RGBColor fTextColor; RGBColor fTabColor; - + RGBColor fTabColorLight; + RGBColor fTabColorShadow; + RGBColor* fFrameColors; // Individual rects for handling window frame