From 76b895fb5c392c73d86e5a0401b48921629e0842 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Wed, 29 Mar 2006 11:23:31 +0000 Subject: [PATCH] Vertical alignment of bitmaps and shortcut char is calculated more correctly (hopefully). Should fix bug 352 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16921 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/MenuItem.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/kits/interface/MenuItem.cpp b/src/kits/interface/MenuItem.cpp index 56308b29fe..38f3068a4e 100644 --- a/src/kits/interface/MenuItem.cpp +++ b/src/kits/interface/MenuItem.cpp @@ -702,16 +702,17 @@ void BMenuItem::DrawShortcutSymbol() { // TODO: Review this - BPoint where(ContentLocation() + BPoint(fBounds.Width() - 28.0f, fBounds.Height() - 5.0f)); + BPoint where = ContentLocation(); + where.x += fBounds.Width() - 28; if (fSubmenu) where.x -= 12; // TODO: If the shortcut is one of B_DOWN_ARROW, B_UP_ARROW, B_ENTER, etc. // we can't just use DrawString(), as those aren't valid ascii/UTF8 charachters. // In that case we need to build a BBitmap for the given shortcut and draw it using DrawBitmap() - fSuper->DrawChar(fShortcutChar, where); + fSuper->DrawChar(fShortcutChar, where + BPoint(0, fSuper->fAscent)); - where -= BPoint(20, 10); + where -= BPoint(20, -1); if (fModifiers & B_COMMAND_KEY) { BRect rect(0,0,16,10);