From 3f0aa1427cdcfdd94ca27693c163230da55ccea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 8 Dec 2005 12:04:51 +0000 Subject: [PATCH] take care of resizing and cleaning up parent BMenuField in FrameResized(), fixes missing areas in Fonts and most likely other BMenuFields git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15413 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/BMCPrivate.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/BMCPrivate.cpp b/src/kits/interface/BMCPrivate.cpp index 6a78dfd59e..499b7a6f0d 100644 --- a/src/kits/interface/BMCPrivate.cpp +++ b/src/kits/interface/BMCPrivate.cpp @@ -203,7 +203,24 @@ void _BMCMenuBar_::Draw(BRect updateRect) //------------------------------------------------------------------------------ void _BMCMenuBar_::FrameResized(float width, float height) { - // TODO: + // we need to take care of resizing and cleaning up + // the parent menu field + BMenuField* menuField = dynamic_cast(Parent()); + if (menuField) { + float diff = Frame().right - menuField->Bounds().right; + if (diff > 0 && Window()) { + // clean up the dirty right top corner of + // the menu field when enlarging + BRect dirty(menuField->Bounds()); + dirty.left = dirty.right - 2; + dirty.bottom = Frame().top - 1; + menuField->Invalidate(dirty); + } + // we have been shrinked or enlarged and need to take + // of the size of the parent menu field as well + // NOTE: no worries about follow mode, we follow left and top + menuField->ResizeBy(diff + 1, 0.0); + } BMenuBar::FrameResized(width, height); } //------------------------------------------------------------------------------