From 2a5ee8702997f303f3375f521aae7723f44f9295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 17 Oct 2009 22:46:27 +0000 Subject: [PATCH] Implemented enhencement ticket #4799. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33629 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/deskbar/WindowMenuItem.cpp | 70 +++++++++++++++-------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/src/apps/deskbar/WindowMenuItem.cpp b/src/apps/deskbar/WindowMenuItem.cpp index 0cb00e8b26..f133f0ad6d 100644 --- a/src/apps/deskbar/WindowMenuItem.cpp +++ b/src/apps/deskbar/WindowMenuItem.cpp @@ -170,41 +170,43 @@ TWindowMenuItem::GetContentSize(float* width, float* height) void TWindowMenuItem::Draw() { - if (fExpanded) { - rgb_color menuColor = Menu()->ViewColor(); - BRect frame(Frame()); - BMenu* menu = Menu(); - - menu->PushState(); - - // if not selected or being tracked on, fill with gray - TBarView* barview = (static_cast(be_app))->BarView(); - if (!IsSelected() && !menu->IsRedrawAfterSticky() - || barview->Dragging() || !IsEnabled()) { - menu->SetHighColor(menuColor); - menu->FillRect(frame); - - if (fExpanded) { - rgb_color shadow = tint_color(menuColor, - (B_NO_TINT + B_DARKEN_1_TINT) / 2.0f); - menu->SetHighColor(shadow); - frame.right = frame.left + kHPad / 2; - menu->FillRect(frame); - } - } - - if (IsEnabled() && IsSelected() && !menu->IsRedrawAfterSticky()) { - // fill - menu->SetHighColor(tint_color(menuColor, - B_HIGHLIGHT_BACKGROUND_TINT)); - menu->FillRect(frame); - } else - menu->SetLowColor(menuColor); - - DrawContent(); - menu->PopState(); - } else + if (!fExpanded) { BMenuItem::Draw(); + return; + } + + rgb_color menuColor = tint_color(Menu()->ViewColor(), 1.07); + BRect frame(Frame()); + BMenu* menu = Menu(); + + menu->PushState(); + + // if not selected or being tracked on, fill with gray + TBarView* barview = (static_cast(be_app))->BarView(); + if (!IsSelected() && !menu->IsRedrawAfterSticky() + || barview->Dragging() || !IsEnabled()) { + + rgb_color shadow = tint_color(menuColor, 1.09); + menu->SetHighColor(shadow); + frame.right = frame.left + kHPad / 2; + menu->FillRect(frame); + + menu->SetHighColor(menuColor); + frame.left = frame.right + 1; + frame.right = Frame().right; + menu->FillRect(frame); + } + + if (IsEnabled() && IsSelected() && !menu->IsRedrawAfterSticky()) { + // fill + menu->SetHighColor(tint_color(menuColor, + B_HIGHLIGHT_BACKGROUND_TINT)); + menu->FillRect(frame); + } else + menu->SetLowColor(menuColor); + + DrawContent(); + menu->PopState(); }