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:
parent
b19041249d
commit
08d9291667
@ -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();
|
||||
|
@ -129,13 +129,6 @@ BMenuScroller::Pulse()
|
||||
fMenu->ScrollBy(0, -kScrollStep);
|
||||
fValue -= kScrollStep;
|
||||
}
|
||||
|
||||
// In this case, we need to redraw the lower button because of a
|
||||
// probable bug in ScrollBy handling. The scrolled view is drawing below
|
||||
// its bounds, dirtying our button in this process.
|
||||
// Redrawing it everytime makes scrolling a little slower.
|
||||
// TODO: Try to find why and fix this.
|
||||
Draw(fLowerButton);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user