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
This commit is contained in:
Stefano Ceccherini
2006-03-29 11:23:31 +00:00
parent 793fde40eb
commit 76b895fb5c
+4 -3
View File
@@ -702,16 +702,17 @@ void
BMenuItem::DrawShortcutSymbol() BMenuItem::DrawShortcutSymbol()
{ {
// TODO: Review this // 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) if (fSubmenu)
where.x -= 12; where.x -= 12;
// TODO: If the shortcut is one of B_DOWN_ARROW, B_UP_ARROW, B_ENTER, etc. // 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. // 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() // 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) { if (fModifiers & B_COMMAND_KEY) {
BRect rect(0,0,16,10); BRect rect(0,0,16,10);