SATDecorator: use the correct tab color

The tab color used for the SAT highlight was hardcoded to the default
yellow. Instead get it from the decorator settings.

Fixes #11571.
This commit is contained in:
Adrien Destugues 2014-12-09 09:34:08 +01:00
parent 4380baa4d7
commit ae0218ed54
2 changed files with 19 additions and 20 deletions

View File

@ -46,22 +46,16 @@ static const rgb_color kHighlightFrameColors[6] = {
{ 8, 8, 8, 255 }
};
static const rgb_color kTabColor = {255, 203, 0, 255};
static const rgb_color kHighlightTabColor = tint_color(kTabColor,
B_DARKEN_2_TINT);
static const rgb_color kHighlightTabColorLight = tint_color(kHighlightTabColor,
(B_LIGHTEN_MAX_TINT + B_LIGHTEN_2_TINT) / 2);
static const rgb_color kHighlightTabColorBevel = tint_color(kHighlightTabColor,
B_LIGHTEN_2_TINT);
static const rgb_color kHighlightTabColorShadow = tint_color(kHighlightTabColor,
(B_DARKEN_1_TINT + B_NO_TINT) / 2);
SATDecorator::SATDecorator(DesktopSettings& settings, BRect frame)
:
DefaultDecorator(settings, frame)
DefaultDecorator(settings, frame),
kHighlightTabColor(tint_color(kFocusTabColor, B_DARKEN_2_TINT)),
kHighlightTabColorLight(tint_color(kHighlightTabColor,
(B_LIGHTEN_MAX_TINT + B_LIGHTEN_2_TINT) / 2)),
kHighlightTabColorBevel(tint_color(kHighlightTabColor, B_LIGHTEN_2_TINT)),
kHighlightTabColorShadow(tint_color(kHighlightTabColor,
(B_DARKEN_1_TINT + B_NO_TINT) / 2))
{
}
@ -70,18 +64,17 @@ SATDecorator::GetComponentColors(Component component, uint8 highlight,
ComponentColors _colors, Decorator::Tab* _tab)
{
DefaultDecorator::Tab* tab = static_cast<DefaultDecorator::Tab*>(_tab);
// we handle only our own highlights
if (highlight != HIGHLIGHT_STACK_AND_TILE) {
DefaultDecorator::GetComponentColors(component, highlight,
_colors, tab);
// Get the standard colors from the DefaultDecorator
DefaultDecorator::GetComponentColors(component, highlight, _colors, tab);
// Now we need to make some changes if the Stack and tile highlight is used
if (highlight != HIGHLIGHT_STACK_AND_TILE)
return;
}
if (tab && tab->isHighlighted == false
&& (component == COMPONENT_TAB || component == COMPONENT_CLOSE_BUTTON
|| component == COMPONENT_ZOOM_BUTTON)) {
DefaultDecorator::GetComponentColors(component, highlight,
_colors, tab);
return;
}

View File

@ -29,6 +29,12 @@ protected:
virtual void GetComponentColors(Component component,
uint8 highlight, ComponentColors _colors,
Decorator::Tab* tab = NULL);
private:
const rgb_color kHighlightTabColor;
const rgb_color kHighlightTabColorLight;
const rgb_color kHighlightTabColorBevel;
const rgb_color kHighlightTabColorShadow;
};