From afd60167e36d877d194f82b91069763ec2e0a7b8 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Wed, 7 Nov 2007 09:38:55 +0000 Subject: [PATCH] Reverted r21395. Many people didn't like the change, and after all I too think it wasn't a really good idea. The alignment of shortcut charachters and submenu symbols could use some more work, though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22849 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/interface/Menu.h | 2 +- src/kits/interface/Menu.cpp | 7 +------ src/kits/interface/MenuItem.cpp | 9 +++------ 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/headers/os/interface/Menu.h b/headers/os/interface/Menu.h index 1d97e87b8a..8d187aeaee 100644 --- a/headers/os/interface/Menu.h +++ b/headers/os/interface/Menu.h @@ -259,7 +259,7 @@ private: LayoutData* fLayoutData; - int32 fSubmenus; + int32 _reserved; char fTrigger; bool fResizeToFit; diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index 076aa8a7ba..9550d5496c 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -189,7 +189,6 @@ BMenu::BMenu(const char *name, menu_layout layout) fMaxContentWidth(0.0f), fInitMatrixSize(NULL), fExtraMenuData(NULL), - fSubmenus(0), fTrigger(0), fResizeToFit(true), fUseCachedMenuLayout(false), @@ -223,7 +222,6 @@ BMenu::BMenu(const char *name, float width, float height) fMaxContentWidth(0.0f), fInitMatrixSize(NULL), fExtraMenuData(NULL), - fSubmenus(0), fTrigger(0), fResizeToFit(true), fUseCachedMenuLayout(false), @@ -270,7 +268,6 @@ BMenu::BMenu(BMessage *archive) fMaxContentWidth(0.0f), fInitMatrixSize(NULL), fExtraMenuData(NULL), - fSubmenus(0), fTrigger(0), fResizeToFit(true), fUseCachedMenuLayout(false), @@ -1089,7 +1086,6 @@ BMenu::BMenu(BRect frame, const char *name, uint32 resizingMode, uint32 flags, fMaxContentWidth(0.0f), fInitMatrixSize(NULL), fExtraMenuData(NULL), - fSubmenus(0), fTrigger(0), fResizeToFit(resizeToFit), fUseCachedMenuLayout(false), @@ -1734,8 +1730,7 @@ BMenu::_ComputeColumnLayout(int32 index, bool bestFit, bool moveItems, item->fBounds.bottom = item->fBounds.top + iHeight + fPad.top + fPad.bottom; - if (fSubmenus) - iWidth += item->Frame().Height(); + iWidth += item->Frame().Height(); frame.right = max_c(frame.right, iWidth + fPad.left + fPad.right); frame.bottom = item->fBounds.bottom + 1.0f; diff --git a/src/kits/interface/MenuItem.cpp b/src/kits/interface/MenuItem.cpp index 93ed8c02bf..7098b776b2 100644 --- a/src/kits/interface/MenuItem.cpp +++ b/src/kits/interface/MenuItem.cpp @@ -640,10 +640,6 @@ BMenuItem::SetSuper(BMenu *super) debugger("Error - can't add menu or menu item to more than 1 container (either menu or menubar)."); if (fSubmenu != NULL) { - if (super) - super->fSubmenus++; - else if (fSuper) - fSuper->fSubmenus--; fSubmenu->fSuper = super; } @@ -715,8 +711,9 @@ BMenuItem::_DrawShortcutSymbol() menu->GetFont(&font); BPoint where = ContentLocation(); where.x = fBounds.right - font.Size(); - if (menu->fSubmenus) - where.x -= fBounds.Height() - 4; + + if (fSubmenu) + where.x -= fBounds.Height() - 3; switch (fShortcutChar) { case B_DOWN_ARROW: