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:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user