removed now unneded extra Draw() call used as a workaround to broken

scrolling.
Menu attached to menubars now use scrolling if they are opened near the 
bottom of the screen (just like in beos). I'm not sure if this is so 
nice, though, so it could be reverted. Patch contributed by Lucasz 
Zemczak


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19442 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2006-12-07 11:25:24 +00:00
parent b19041249d
commit 08d9291667
2 changed files with 18 additions and 12 deletions
+18 -5
View File
@@ -1712,8 +1712,15 @@ BMenu::CalcFrame(BPoint where, bool *scrollOn)
if (frame.bottom > screenFrame.bottom)
frame.OffsetBy(0, screenFrame.bottom - frame.bottom);
} else {
if (frame.bottom > screenFrame.bottom)
frame.OffsetBy(0, -superItem->Frame().Height() - frame.Height() - 3);
if (frame.bottom > screenFrame.bottom) {
if (scrollOn != NULL && superMenu != NULL &&
dynamic_cast<BMenuBar *>(superMenu) != NULL &&
frame.top < (screenFrame.bottom - 80)) {
*scrollOn = true;
} else {
frame.OffsetBy(0, -superItem->Frame().Height() - frame.Height() - 3);
}
}
if (frame.right > screenFrame.right)
frame.OffsetBy(screenFrame.right - frame.right, 0);
@@ -2094,11 +2101,17 @@ BMenu::UpdateWindowViewSize(bool upWind)
// If we need scrolling, resize the window to fit the screen and
// attach scrollers to our cached MenuWindow.
window->ResizeTo(Bounds().Width() + 2, screen.Frame().bottom - 10);
if (dynamic_cast<BMenuBar *>(Supermenu()) == NULL) {
window->ResizeTo(Bounds().Width() + 2, screen.Frame().bottom - 10);
frame.top = 0;
}
else {
// Or, in case our parent was a BMenuBar enable scrolling with
// normal size.
window->ResizeTo(Bounds().Width() + 2, screen.Frame().bottom - frame.top);
}
static_cast<BMenuWindow *>(window)->AttachScrollers();
frame.top = 0;
}
} else {
CacheFontInfo();