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
This commit is contained in:
Stefano Ceccherini 2006-08-13 06:06:00 +00:00
parent 509c95da0e
commit bfb0aa18d3

View File

@ -1524,7 +1524,9 @@ BMenu::ComputeLayout(int32 index, bool bestFit, bool moveItems,
BRect frame(0, 0, 0, 0); BRect frame(0, 0, 0, 0);
float iWidth, iHeight; float iWidth, iHeight;
BMenuItem *item = NULL; BMenuItem *item = NULL;
BFont font;
GetFont(&font);
switch (fLayout) { switch (fLayout) {
case B_ITEMS_IN_COLUMN: case B_ITEMS_IN_COLUMN:
{ {
@ -1534,9 +1536,9 @@ BMenu::ComputeLayout(int32 index, bool bestFit, bool moveItems,
item->GetContentSize(&iWidth, &iHeight); item->GetContentSize(&iWidth, &iHeight);
if (item->fModifiers && item->fShortcutChar) if (item->fModifiers && item->fShortcutChar)
iWidth += 25.0f; iWidth += 2 * font.Size();
if (item->fSubmenu != NULL) if (item->fSubmenu != NULL)
iWidth += 20.0f; iWidth += 2 * font.Size();
item->fBounds.left = 0.0f; item->fBounds.left = 0.0f;
item->fBounds.top = frame.bottom; item->fBounds.top = frame.bottom;