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
TWindowMenuItem::Draw()
{
if (fExpanded) {
rgb_color menuColor = Menu()->ViewColor();
if (!fExpanded) {
BMenuItem::Draw();
return;
}
rgb_color menuColor = tint_color(Menu()->ViewColor(), 1.07);
BRect frame(Frame());
BMenu* menu = Menu();
@@ -181,16 +185,16 @@ TWindowMenuItem::Draw()
TBarView* barview = (static_cast<TBarApp*>(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);
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()) {
@@ -203,8 +207,6 @@ TWindowMenuItem::Draw()
DrawContent();
menu->PopState();
} else
BMenuItem::Draw();
}