From 5ef44d9bfc4e1eab4c50ee92263e295ead09915c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 18 Mar 2009 17:24:08 +0000 Subject: [PATCH] * Do not draw the BMenuItem content twice. (Fixes bad anti-aliasing of labels when applications are expanded in the Deskbar.) * Simplified setting B_OP_COPY drawing mode. * PopState() at the end of drawing, not before. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29601 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/deskbar/WindowMenuItem.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/apps/deskbar/WindowMenuItem.cpp b/src/apps/deskbar/WindowMenuItem.cpp index a6fcd5edfb..48319ae86c 100644 --- a/src/apps/deskbar/WindowMenuItem.cpp +++ b/src/apps/deskbar/WindowMenuItem.cpp @@ -203,8 +203,8 @@ TWindowMenuItem::Draw() DrawContent(); menu->PopState(); - } - BMenuItem::Draw(); + } else + BMenuItem::Draw(); } @@ -218,7 +218,6 @@ TWindowMenuItem::DrawContent() BPoint contLoc = ContentLocation() + BPoint(kHPad, kVPad); // if (fExpanded) // contLoc.x += kHPad; - menu->SetDrawingMode(B_OP_COPY); if (fID >= 0) { menu->SetDrawingMode(B_OP_OVER); @@ -235,18 +234,20 @@ TWindowMenuItem::DrawContent() contLoc.x += 8; contLoc.x += kIconRect.Width() + kLabelOffset; - - menu->SetDrawingMode(B_OP_COPY); } + + menu->SetDrawingMode(B_OP_COPY); + contLoc.y = frame.top + ((frame.Height() - fTitleAscent - fTitleDescent) / 2) + 1.0f; - menu->PopState(); menu->MovePenTo(contLoc); // Set the pen color so that the label is always visible. menu->SetHighColor(0, 0, 0); BMenuItem::DrawContent(); + + menu->PopState(); }