From 0095fe722a4c08b59aff3d863a740f37b5f00562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 14 Sep 2008 18:52:30 +0000 Subject: [PATCH] * Added a comment about the purpose of the code in AttachedToWindow(). * Improved FrameResized(). The "diff" is actually between the new location of the right side (Frame().right) and the location where it probably was in the parent before it is resized (fMenuField->Bounds().right - 2). Could be that this change is wrong, or at least, not yet correct. Will test on a different machine. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27507 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/BMCPrivate.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/BMCPrivate.cpp b/src/kits/interface/BMCPrivate.cpp index 2170973508..dbb2564e09 100644 --- a/src/kits/interface/BMCPrivate.cpp +++ b/src/kits/interface/BMCPrivate.cpp @@ -116,6 +116,7 @@ _BMCMenuBar_::AttachedToWindow() { fMenuField = static_cast(Parent()); + // Don't cause the KeyMenuBar to change by being attached BMenuBar *menuBar = Window()->KeyMenuBar(); BMenuBar::AttachedToWindow(); if (fFixedSize) @@ -236,7 +237,7 @@ _BMCMenuBar_::FrameResized(float width, float height) if (fFixedSize) diff = width - fPreviousWidth; else - diff = Frame().right - fMenuField->Bounds().right; + diff = Frame().right - (fMenuField->Bounds().right - 2); fPreviousWidth = width; @@ -272,7 +273,7 @@ _BMCMenuBar_::FrameResized(float width, float height) // of the size of the parent menu field as well // NOTE: no worries about follow mode, we follow left and top // in autosize mode - fMenuField->ResizeBy(diff + 2, 0.0); + fMenuField->ResizeBy(diff, 0.0); } BMenuBar::FrameResized(width, height); }