From bfb0aa18d38c1367c26ee8de9fa2dab2a8010444 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Sun, 13 Aug 2006 06:06:00 +0000 Subject: [PATCH] some adjustments at the menu width calculation. Menus are generally a bit less 'compacted' now. Might need review git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18501 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Menu.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index 2b2893333b..70963718cd 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -1524,7 +1524,9 @@ BMenu::ComputeLayout(int32 index, bool bestFit, bool moveItems, BRect frame(0, 0, 0, 0); float iWidth, iHeight; BMenuItem *item = NULL; - + + BFont font; + GetFont(&font); switch (fLayout) { case B_ITEMS_IN_COLUMN: { @@ -1534,9 +1536,9 @@ BMenu::ComputeLayout(int32 index, bool bestFit, bool moveItems, item->GetContentSize(&iWidth, &iHeight); if (item->fModifiers && item->fShortcutChar) - iWidth += 25.0f; + iWidth += 2 * font.Size(); if (item->fSubmenu != NULL) - iWidth += 20.0f; + iWidth += 2 * font.Size(); item->fBounds.left = 0.0f; item->fBounds.top = frame.bottom;