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
This commit is contained in:
Stephan Aßmus
2005-12-10 13:58:42 +00:00
parent a447191925
commit 2b98735f6d
+17 -8
View File
@@ -208,18 +208,27 @@ void _BMCMenuBar_::FrameResized(float width, float height)
BMenuField* menuField = dynamic_cast<BMenuField*>(Parent()); BMenuField* menuField = dynamic_cast<BMenuField*>(Parent());
if (menuField) { if (menuField) {
float diff = Frame().right - menuField->Bounds().right; float diff = Frame().right - menuField->Bounds().right;
if (diff > 0 && Window()) { if (Window()) {
// clean up the dirty right top corner of if (diff > 0) {
// the menu field when enlarging // clean up the dirty right top corner of
BRect dirty(menuField->Bounds()); // the menu field when enlarging
dirty.left = dirty.right - 2; BRect dirty(menuField->Bounds());
dirty.bottom = Frame().top - 1; dirty.left = dirty.right - 2;
menuField->Invalidate(dirty); 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 // we have been shrinked or enlarged and need to take
// 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
menuField->ResizeBy(diff + 1, 0.0); menuField->ResizeBy(diff + 2, 0.0);
} }
BMenuBar::FrameResized(width, height); BMenuBar::FrameResized(width, height);
} }