hrev45745 adds 1 changeset to branch 'master' old head: 37e0f72711931894390cf660f521beff2fa08b10 new head: 1c95f72222f766079af3183ab490e42506f5feca overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=1c95f72+%5E37e0f72 ---------------------------------------------------------------------------- 1c95f72: Don't set MaxContentWidth on the menu bar of a BMenuField Fixes #9816 It is no longer necessary, or even desirable for us to set the max content width of the menu bar of a BMenuField now that BMenuItem truncation and BMenuField sizing are working. The user may, however, wish to set the max content width of the menu bar of a BMenuField themselves like so: menuField->MenuBar()->SetMaxContentWidth(width); and the Interface Kit will automatically deduct the left and right margins from the width including the space used by the drop down arrow. [ John Scipione <jscipione@xxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev45745 Commit: 1c95f72222f766079af3183ab490e42506f5feca URL: http://cgit.haiku-os.org/haiku/commit/?id=1c95f72 Author: John Scipione <jscipione@xxxxxxxxx> Date: Fri Jun 7 07:25:36 2013 UTC Ticket: https://dev.haiku-os.org/ticket/9816 ---------------------------------------------------------------------------- 3 files changed, 5 insertions(+), 11 deletions(-) headers/private/interface/BMCPrivate.h | 2 +- src/kits/interface/BMCPrivate.cpp | 9 +++------ src/kits/interface/MenuField.cpp | 5 +---- ---------------------------------------------------------------------------- diff --git a/headers/private/interface/BMCPrivate.h b/headers/private/interface/BMCPrivate.h index 5581d88..876ad1f 100644 --- a/headers/private/interface/BMCPrivate.h +++ b/headers/private/interface/BMCPrivate.h @@ -64,7 +64,7 @@ public: private: _BMCMenuBar_&operator=(const _BMCMenuBar_&); - void _Init(bool setMaxContentWidth); + void _Init(); BMenuField* fMenuField; bool fFixedSize; diff --git a/src/kits/interface/BMCPrivate.cpp b/src/kits/interface/BMCPrivate.cpp index 023769a..e46eef5 100644 --- a/src/kits/interface/BMCPrivate.cpp +++ b/src/kits/interface/BMCPrivate.cpp @@ -67,7 +67,7 @@ _BMCMenuBar_::_BMCMenuBar_(BRect frame, bool fixedSize, BMenuField* menuField) fRunner(NULL), fShowPopUpMarker(true) { - _Init(fixedSize); + _Init(); } @@ -79,7 +79,7 @@ _BMCMenuBar_::_BMCMenuBar_(BMenuField* menuField) fRunner(NULL), fShowPopUpMarker(true) { - _Init(true); + _Init(); } @@ -303,7 +303,7 @@ _BMCMenuBar_::MaxSize() void -_BMCMenuBar_::_Init(bool setMaxContentWidth) +_BMCMenuBar_::_Init() { SetFlags(Flags() | B_FRAME_EVENTS); SetBorder(B_BORDER_CONTENTS); @@ -334,7 +334,4 @@ _BMCMenuBar_::_Init(bool setMaxContentWidth) right + fShowPopUpMarker ? kPopUpIndicatorWidth : 0, bottom); fPreviousWidth = Bounds().Width(); - - if (setMaxContentWidth) - SetMaxContentWidth(fPreviousWidth); } diff --git a/src/kits/interface/MenuField.cpp b/src/kits/interface/MenuField.cpp index e30fe66..f660b9e 100644 --- a/src/kits/interface/MenuField.cpp +++ b/src/kits/interface/MenuField.cpp @@ -547,7 +547,6 @@ BMenuField::FrameResized(float newWidth, float newHeight) // resizing ourselfs might have caused the menubar // to be outside now fMenuBar->ResizeTo(_MenuBarWidth(), fMenuBar->Frame().Height()); - fMenuBar->SetMaxContentWidth(_MenuBarWidth()); } if (newHeight != fLayoutData->previous_height && Label()) { @@ -665,10 +664,8 @@ BMenuField::SetDivider(float position) fMenuBar->MoveTo(_MenuBarOffset(), kVMargin); - if (fFixedSizeMB) { + if (fFixedSizeMB) fMenuBar->ResizeTo(_MenuBarWidth(), dirty.Height()); - fMenuBar->SetMaxContentWidth(_MenuBarWidth()); - } dirty = dirty | fMenuBar->Frame(); dirty.InsetBy(-kVMargin, -kVMargin);