* When a BMenuItem contains a submenu, and that menu IsLabelFromMarked(), use its preferred width as the content width in GetContentSize().

This fixes problems with the Min/PreferredSize() calculations for BMenuField, with a Menu that IsLabelFromMarked().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36752 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ithamar R. Adema 2010-05-08 19:03:33 +00:00
parent bbb55d159e
commit b513501fe4

View File

@ -365,7 +365,10 @@ BMenuItem::GetContentSize(float *width, float *height)
// BFont::Height() caches the value locally
MenuPrivate(fSuper).CacheFontInfo();
fCachedWidth = fSuper->StringWidth(fLabel);
if (fSubmenu && fSubmenu->IsLabelFromMarked())
fSubmenu->GetPreferredSize(&fCachedWidth, NULL);
else
fCachedWidth = fSuper->StringWidth(fLabel);
if (width)
*width = (float)ceil(fCachedWidth);