* 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
This commit is contained in:
@@ -116,6 +116,7 @@ _BMCMenuBar_::AttachedToWindow()
|
|||||||
{
|
{
|
||||||
fMenuField = static_cast<BMenuField *>(Parent());
|
fMenuField = static_cast<BMenuField *>(Parent());
|
||||||
|
|
||||||
|
// Don't cause the KeyMenuBar to change by being attached
|
||||||
BMenuBar *menuBar = Window()->KeyMenuBar();
|
BMenuBar *menuBar = Window()->KeyMenuBar();
|
||||||
BMenuBar::AttachedToWindow();
|
BMenuBar::AttachedToWindow();
|
||||||
if (fFixedSize)
|
if (fFixedSize)
|
||||||
@@ -236,7 +237,7 @@ _BMCMenuBar_::FrameResized(float width, float height)
|
|||||||
if (fFixedSize)
|
if (fFixedSize)
|
||||||
diff = width - fPreviousWidth;
|
diff = width - fPreviousWidth;
|
||||||
else
|
else
|
||||||
diff = Frame().right - fMenuField->Bounds().right;
|
diff = Frame().right - (fMenuField->Bounds().right - 2);
|
||||||
|
|
||||||
fPreviousWidth = width;
|
fPreviousWidth = width;
|
||||||
|
|
||||||
@@ -272,7 +273,7 @@ _BMCMenuBar_::FrameResized(float width, float height)
|
|||||||
// of the size of the parent menu field as well
|
// of the size of the parent menu field as well
|
||||||
// NOTE: no worries about follow mode, we follow left and top
|
// NOTE: no worries about follow mode, we follow left and top
|
||||||
// in autosize mode
|
// in autosize mode
|
||||||
fMenuField->ResizeBy(diff + 2, 0.0);
|
fMenuField->ResizeBy(diff, 0.0);
|
||||||
}
|
}
|
||||||
BMenuBar::FrameResized(width, height);
|
BMenuBar::FrameResized(width, height);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user