Improve cosmetics when menu scrollers are shown. The menu is not supposed to

draw all of the frame (no top/bottom borders).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29532 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2009-03-14 21:47:48 +00:00
parent 49cc2c3bf8
commit c7bb90f8de
2 changed files with 17 additions and 5 deletions

View File

@ -1305,7 +1305,19 @@ BMenu::DrawBackground(BRect update)
if (IsFocus())
flags |= BControlLook::B_FOCUSED;
BRect rect = Bounds();
be_control_look->DrawMenuBackground(this, rect, update, base);
uint32 borders = BControlLook::B_LEFT_BORDER
| BControlLook::B_RIGHT_BORDER;
if (Window() != NULL && Parent() != NULL) {
if (Parent()->Frame().top == Window()->Bounds().top)
borders |= BControlLook::B_TOP_BORDER;
if (Parent()->Frame().bottom == Window()->Bounds().bottom)
borders |= BControlLook::B_BOTTOM_BORDER;
} else {
borders |= BControlLook::B_TOP_BORDER
| BControlLook::B_BOTTOM_BORDER;
}
be_control_look->DrawMenuBackground(this, rect, update, base, 0,
borders);
return;
}

View File

@ -303,21 +303,21 @@ BMenuWindow::AttachScrollers()
if (fUpperScroller == NULL) {
fUpperScroller = new UpperScroller(
BRect(0, 0, frame.right, kScrollerHeight));
BRect(0, 0, frame.right, kScrollerHeight - 1));
AddChild(fUpperScroller);
}
if (fLowerScroller == NULL) {
fLowerScroller = new LowerScroller(
BRect(0, frame.bottom - kScrollerHeight,
frame.right, frame.bottom));
BRect(0, frame.bottom - kScrollerHeight + 1, frame.right,
frame.bottom));
AddChild(fLowerScroller);
}
fUpperScroller->SetEnabled(false);
fLowerScroller->SetEnabled(true);
fMenuFrame->ResizeBy(0, -2 * kScrollerHeight - 1);
fMenuFrame->ResizeBy(0, -2 * kScrollerHeight);
fMenuFrame->MoveBy(0, kScrollerHeight);
fValue = 0;