Resize menu field menu bar iff fFixedSize is true

If the menu field is not fixed size than the width of the menu bar
should depend on the menu item contents so just do the default and
get the Bounds() without any extra resizing.
This commit is contained in:
John Scipione 2013-05-08 13:55:58 -04:00
parent a61d468cf9
commit ec1f08fb05
1 changed files with 7 additions and 6 deletions

View File

@ -137,13 +137,14 @@ _BMCMenuBar_::AttachedToWindow()
void
_BMCMenuBar_::Draw(BRect updateRect)
{
float height;
GetPreferredSize(NULL, &height);
ResizeTo(fMenuField->_MenuBarWidth(), height);
// Set the width to the menu field width because the menubar
// bounds are expanded by the selected menu item.
if (fFixedSize) {
float height;
GetPreferredSize(NULL, &height);
ResizeTo(fMenuField->_MenuBarWidth(), height);
// Set the width to the menu field width because the menubar
// bounds are expanded by the selected menu item.
}
BRect rect(Bounds());
rgb_color base = ui_color(B_MENU_BACKGROUND_COLOR);
uint32 flags = 0;
if (!IsEnabled())