[haiku-commits] haiku: hrev48465 - src/servers/app/stackandtile

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 9 Dec 2014 09:34:30 +0100 (CET)

hrev48465 adds 1 changeset to branch 'master'
old head: 4380baa4d72d9146e7b35baa2378272c6378c285
new head: ae0218ed54550614e127f513f3172e8d637de3b7
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=ae0218e+%5E4380baa

----------------------------------------------------------------------------

ae0218e: 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.

                                 [ Adrien Destugues <pulkomandy@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev48465
Commit:      ae0218ed54550614e127f513f3172e8d637de3b7
URL:         http://cgit.haiku-os.org/haiku/commit/?id=ae0218e
Author:      Adrien Destugues <pulkomandy@xxxxxxxxx>
Date:        Tue Dec  9 08:34:08 2014 UTC

Ticket:      https://dev.haiku-os.org/ticket/11571

----------------------------------------------------------------------------

2 files changed, 19 insertions(+), 20 deletions(-)
src/servers/app/stackandtile/SATDecorator.cpp | 33 +++++++++--------------
src/servers/app/stackandtile/SATDecorator.h   |  6 +++++

----------------------------------------------------------------------------

diff --git a/src/servers/app/stackandtile/SATDecorator.cpp 
b/src/servers/app/stackandtile/SATDecorator.cpp
index be51dea..d4c1503 100644
--- a/src/servers/app/stackandtile/SATDecorator.cpp
+++ b/src/servers/app/stackandtile/SATDecorator.cpp
@@ -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;
        }
 
diff --git a/src/servers/app/stackandtile/SATDecorator.h 
b/src/servers/app/stackandtile/SATDecorator.h
index d7b7348..9c2bcd4 100644
--- a/src/servers/app/stackandtile/SATDecorator.h
+++ b/src/servers/app/stackandtile/SATDecorator.h
@@ -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;
 };
 
 


Other related posts: