[haiku-commits] haiku: hrev45274 - src/apps/deskbar

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 12 Feb 2013 04:31:36 +0100 (CET)

hrev45274 adds 1 changeset to branch 'master'
old head: 3c6d2325c708750408ddbfa8863da9266d34bbb3
new head: 859c378175de9013dda77d57199efc4c962215e0
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=859c378+%5E3c6d232

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

859c378: Update Deskbar to use menu text and selected menu text color prefs.
  
  ... in a couple of places where colors where being hardcoded.
  
  Fixes #9119

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

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

Revision:    hrev45274
Commit:      859c378175de9013dda77d57199efc4c962215e0
URL:         http://cgit.haiku-os.org/haiku/commit/?id=859c378
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Tue Feb 12 03:29:49 2013 UTC

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

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

3 files changed, 18 insertions(+), 8 deletions(-)
src/apps/deskbar/BarMenuTitle.cpp   | 11 ++++++++---
src/apps/deskbar/TeamMenuItem.cpp   |  8 +++++---
src/apps/deskbar/WindowMenuItem.cpp |  7 +++++--

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

diff --git a/src/apps/deskbar/BarMenuTitle.cpp 
b/src/apps/deskbar/BarMenuTitle.cpp
index 7506ddc..cf877a1 100644
--- a/src/apps/deskbar/BarMenuTitle.cpp
+++ b/src/apps/deskbar/BarMenuTitle.cpp
@@ -133,7 +133,6 @@ TBarMenuTitle::DrawContent()
        rgb_color menuColor = menu->LowColor();
        rgb_color dark = tint_color(menuColor, B_DARKEN_1_TINT);
        rgb_color light = tint_color(menuColor, B_LIGHTEN_2_TINT);
-       rgb_color black = {0, 0, 0, 255};
 
        bool inExpandoMode = dynamic_cast<TExpandoMenuBar*>(menu) != NULL;
 
@@ -161,7 +160,10 @@ TBarMenuTitle::DrawContent()
                frame.InsetBy(1, 1);
                menu->SetHighColor(menuColor);
                menu->FillRect(frame);
-               menu->SetHighColor(black);
+               if (IsSelected())
+                       
menu->SetHighColor(ui_color(B_MENU_SELECTED_ITEM_TEXT_COLOR));
+               else
+                       menu->SetHighColor(ui_color(B_MENU_ITEM_TEXT_COLOR));
                frame.InsetBy(-1, -1);
                if (inExpandoMode)
                        frame.top -= 1;
@@ -177,7 +179,10 @@ TBarMenuTitle::DrawContent()
                        menu->StrokeLine(frame.LeftTop(), frame.LeftBottom());
                }
 
-               menu->SetHighColor(black);
+               if (IsSelected())
+                       
menu->SetHighColor(ui_color(B_MENU_SELECTED_ITEM_TEXT_COLOR));
+               else
+                       menu->SetHighColor(ui_color(B_MENU_ITEM_TEXT_COLOR));
        }
 
        menu->SetDrawingMode(B_OP_ALPHA);
diff --git a/src/apps/deskbar/TeamMenuItem.cpp 
b/src/apps/deskbar/TeamMenuItem.cpp
index 8a7474b..692f3ce 100644
--- a/src/apps/deskbar/TeamMenuItem.cpp
+++ b/src/apps/deskbar/TeamMenuItem.cpp
@@ -395,9 +395,6 @@ TTeamMenuItem::DrawContent()
                menu->MovePenTo(drawLoc);
        }
 
-       // set the pen to black so that either method will draw in the same 
color
-       // low color is set in inherited::DrawContent, override makes sure its
-       // what we want
        if (fDrawLabel) {
                menu->SetDrawingMode(B_OP_OVER);
                menu->SetHighColor(ui_color(B_MENU_ITEM_TEXT_COLOR));
@@ -513,6 +510,11 @@ TTeamMenuItem::DrawContentLabel()
        else
                menu->SetLowColor(menu->LowColor());
 
+       if (IsSelected())
+               menu->SetHighColor(ui_color(B_MENU_SELECTED_ITEM_TEXT_COLOR));
+       else
+               menu->SetHighColor(ui_color(B_MENU_ITEM_TEXT_COLOR));
+
        menu->DrawString(label);
 
        free(truncLabel);
diff --git a/src/apps/deskbar/WindowMenuItem.cpp 
b/src/apps/deskbar/WindowMenuItem.cpp
index 98d93e3..21559c5 100644
--- a/src/apps/deskbar/WindowMenuItem.cpp
+++ b/src/apps/deskbar/WindowMenuItem.cpp
@@ -272,8 +272,11 @@ TWindowMenuItem::DrawContent()
                + ((frame.Height() - fTitleAscent - fTitleDescent) / 2) + 1.0f;
 
        menu->MovePenTo(contLoc);
-       // Set the pen color so that the label is always visible.
-       menu->SetHighColor(ui_color(B_MENU_ITEM_TEXT_COLOR));
+
+       if (IsSelected())
+               menu->SetHighColor(ui_color(B_MENU_SELECTED_ITEM_TEXT_COLOR));
+       else
+               menu->SetHighColor(ui_color(B_MENU_ITEM_TEXT_COLOR));
 
        BMenuItem::DrawContent();
 


Other related posts:

  • » [haiku-commits] haiku: hrev45274 - src/apps/deskbar - jscipione