Shortcut characters are aligned even if there's a submenu, like
discussed in the thread in haiku-development. I added a fSubmenus member to BMenu, to be able to tell from BMenuItem if there are other items with a submenu (maintained in BMenuItem::SetSuper()). If you don't like this solution, let's just revert. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21395 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -160,6 +160,7 @@ BMenu::BMenu(const char *name, menu_layout layout)
|
||||
fMaxContentWidth(0.0f),
|
||||
fInitMatrixSize(NULL),
|
||||
fExtraMenuData(NULL),
|
||||
fSubmenus(0),
|
||||
fTrigger(0),
|
||||
fResizeToFit(true),
|
||||
fUseCachedMenuLayout(false),
|
||||
@@ -193,6 +194,7 @@ BMenu::BMenu(const char *name, float width, float height)
|
||||
fMaxContentWidth(0.0f),
|
||||
fInitMatrixSize(NULL),
|
||||
fExtraMenuData(NULL),
|
||||
fSubmenus(0),
|
||||
fTrigger(0),
|
||||
fResizeToFit(true),
|
||||
fUseCachedMenuLayout(false),
|
||||
@@ -238,6 +240,7 @@ BMenu::BMenu(BMessage *archive)
|
||||
fMaxContentWidth(0.0f),
|
||||
fInitMatrixSize(NULL),
|
||||
fExtraMenuData(NULL),
|
||||
fSubmenus(0),
|
||||
fTrigger(0),
|
||||
fResizeToFit(true),
|
||||
fUseCachedMenuLayout(false),
|
||||
@@ -983,6 +986,7 @@ 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),
|
||||
@@ -1594,7 +1598,7 @@ BMenu::_ComputeColumnLayout(int32 index, bool bestFit, bool moveItems, BRect &fr
|
||||
item->fBounds.top = frame.bottom;
|
||||
item->fBounds.bottom = item->fBounds.top + iHeight + fPad.top + fPad.bottom;
|
||||
|
||||
if (item->fSubmenu != NULL)
|
||||
if (fSubmenus)
|
||||
iWidth += item->Frame().Height();
|
||||
|
||||
frame.right = max_c(frame.right, iWidth + fPad.left + fPad.right);
|
||||
|
||||
Reference in New Issue
Block a user