From 2b98735f6d3cc32bd2a2f6c111279ea7092467c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 10 Dec 2005 13:58:42 +0000 Subject: [PATCH] forgot about the right side extra room for the focus indication git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15464 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/BMCPrivate.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/kits/interface/BMCPrivate.cpp b/src/kits/interface/BMCPrivate.cpp index 499b7a6f0d..10ef677bcb 100644 --- a/src/kits/interface/BMCPrivate.cpp +++ b/src/kits/interface/BMCPrivate.cpp @@ -208,18 +208,27 @@ void _BMCMenuBar_::FrameResized(float width, float height) 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); + if (Window()) { + if (diff > 0) { + // 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); + } else if (diff < 0) { + // clean up the dirty right line of + // the menu field when shrinking + BRect dirty(menuField->Bounds()); + dirty.left = dirty.right + diff + 1; + dirty.right = dirty.left + 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); + menuField->ResizeBy(diff + 2, 0.0); } BMenuBar::FrameResized(width, height); }