From ec1f08fb05e916c96194f62ff15f129b2ad66124 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Wed, 8 May 2013 13:55:58 -0400 Subject: [PATCH] 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. --- src/kits/interface/BMCPrivate.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/kits/interface/BMCPrivate.cpp b/src/kits/interface/BMCPrivate.cpp index 79847f1b57..6dc16759fd 100644 --- a/src/kits/interface/BMCPrivate.cpp +++ b/src/kits/interface/BMCPrivate.cpp @@ -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())