Implemented enhencement ticket #4799.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33629 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-10-17 22:46:27 +00:00
parent 0ccd8732ac
commit 2a5ee87029
+12 -10
View File
@@ -170,8 +170,12 @@ TWindowMenuItem::GetContentSize(float* width, float* height)
void void
TWindowMenuItem::Draw() TWindowMenuItem::Draw()
{ {
if (fExpanded) { if (!fExpanded) {
rgb_color menuColor = Menu()->ViewColor(); BMenuItem::Draw();
return;
}
rgb_color menuColor = tint_color(Menu()->ViewColor(), 1.07);
BRect frame(Frame()); BRect frame(Frame());
BMenu* menu = Menu(); BMenu* menu = Menu();
@@ -181,16 +185,16 @@ TWindowMenuItem::Draw()
TBarView* barview = (static_cast<TBarApp*>(be_app))->BarView(); TBarView* barview = (static_cast<TBarApp*>(be_app))->BarView();
if (!IsSelected() && !menu->IsRedrawAfterSticky() if (!IsSelected() && !menu->IsRedrawAfterSticky()
|| barview->Dragging() || !IsEnabled()) { || barview->Dragging() || !IsEnabled()) {
menu->SetHighColor(menuColor);
menu->FillRect(frame);
if (fExpanded) { rgb_color shadow = tint_color(menuColor, 1.09);
rgb_color shadow = tint_color(menuColor,
(B_NO_TINT + B_DARKEN_1_TINT) / 2.0f);
menu->SetHighColor(shadow); menu->SetHighColor(shadow);
frame.right = frame.left + kHPad / 2; frame.right = frame.left + kHPad / 2;
menu->FillRect(frame); menu->FillRect(frame);
}
menu->SetHighColor(menuColor);
frame.left = frame.right + 1;
frame.right = Frame().right;
menu->FillRect(frame);
} }
if (IsEnabled() && IsSelected() && !menu->IsRedrawAfterSticky()) { if (IsEnabled() && IsSelected() && !menu->IsRedrawAfterSticky()) {
@@ -203,8 +207,6 @@ TWindowMenuItem::Draw()
DrawContent(); DrawContent();
menu->PopState(); menu->PopState();
} else
BMenuItem::Draw();
} }