* cache the tab highlight and shadow color
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21819 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -905,12 +905,6 @@ DefaultDecorator::_DrawTab(BRect invalid)
|
|||||||
if (!fTabRect.IsValid() || !invalid.Intersects(fTabRect))
|
if (!fTabRect.IsValid() || !invalid.Intersects(fTabRect))
|
||||||
return;
|
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
|
// outer frame
|
||||||
fDrawingEngine->StrokeLine(fTabRect.LeftTop(), fTabRect.LeftBottom(), fFrameColors[0]);
|
fDrawingEngine->StrokeLine(fTabRect.LeftTop(), fTabRect.LeftBottom(), fFrameColors[0]);
|
||||||
fDrawingEngine->StrokeLine(fTabRect.LeftTop(), fTabRect.RightTop(), fFrameColors[0]);
|
fDrawingEngine->StrokeLine(fTabRect.LeftTop(), fTabRect.RightTop(), fFrameColors[0]);
|
||||||
@@ -922,17 +916,17 @@ DefaultDecorator::_DrawTab(BRect invalid)
|
|||||||
// bevel
|
// bevel
|
||||||
fDrawingEngine->StrokeLine(BPoint(fTabRect.left + 1, fTabRect.top + 1),
|
fDrawingEngine->StrokeLine(BPoint(fTabRect.left + 1, fTabRect.top + 1),
|
||||||
BPoint(fTabRect.left + 1, fTabRect.bottom - (fLook == kLeftTitledWindowLook ? 1 : 0)),
|
BPoint(fTabRect.left + 1, fTabRect.bottom - (fLook == kLeftTitledWindowLook ? 1 : 0)),
|
||||||
tabColorLight);
|
fTabColorLight);
|
||||||
fDrawingEngine->StrokeLine(BPoint(fTabRect.left + 1, fTabRect.top + 1),
|
fDrawingEngine->StrokeLine(BPoint(fTabRect.left + 1, fTabRect.top + 1),
|
||||||
BPoint(fTabRect.right - (fLook == kLeftTitledWindowLook ? 0 : 1), fTabRect.top + 1),
|
BPoint(fTabRect.right - (fLook == kLeftTitledWindowLook ? 0 : 1), fTabRect.top + 1),
|
||||||
tabColorLight);
|
fTabColorLight);
|
||||||
|
|
||||||
if (fLook != kLeftTitledWindowLook) {
|
if (fLook != kLeftTitledWindowLook) {
|
||||||
fDrawingEngine->StrokeLine(BPoint(fTabRect.right - 1, fTabRect.top + 2),
|
fDrawingEngine->StrokeLine(BPoint(fTabRect.right - 1, fTabRect.top + 2),
|
||||||
BPoint(fTabRect.right - 1, fTabRect.bottom), tabColorShadow);
|
BPoint(fTabRect.right - 1, fTabRect.bottom), fTabColorShadow);
|
||||||
} else {
|
} else {
|
||||||
fDrawingEngine->StrokeLine(BPoint(fTabRect.left + 2, fTabRect.bottom - 1),
|
fDrawingEngine->StrokeLine(BPoint(fTabRect.left + 2, fTabRect.bottom - 1),
|
||||||
BPoint(fTabRect.right, fTabRect.bottom - 1), tabColorShadow);
|
BPoint(fTabRect.right, fTabRect.bottom - 1), fTabColorShadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
// fill
|
// fill
|
||||||
@@ -1045,6 +1039,11 @@ DefaultDecorator::_SetFocus()
|
|||||||
// fFrameColors[4].SetColor(152, 152, 152);
|
// fFrameColors[4].SetColor(152, 152, 152);
|
||||||
// fFrameColors[5].SetColor(96, 96, 96);
|
// 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
|
// _SetColors
|
||||||
|
|||||||
@@ -81,7 +81,9 @@ class DefaultDecorator: public Decorator {
|
|||||||
RGBColor fButtonLowColor;
|
RGBColor fButtonLowColor;
|
||||||
RGBColor fTextColor;
|
RGBColor fTextColor;
|
||||||
RGBColor fTabColor;
|
RGBColor fTabColor;
|
||||||
|
RGBColor fTabColorLight;
|
||||||
|
RGBColor fTabColorShadow;
|
||||||
|
|
||||||
RGBColor* fFrameColors;
|
RGBColor* fFrameColors;
|
||||||
|
|
||||||
// Individual rects for handling window frame
|
// Individual rects for handling window frame
|
||||||
|
|||||||
Reference in New Issue
Block a user