Fix a few minor BMenu issues, follup on hrev45610

Only AttachScrollers() and scroll if B_ITEMS_IN_COLUMN because if not we don't
support scrolling anyway. Also, rename superpoint variable to superPoint.
This commit is contained in:
John Scipione
2013-05-03 16:27:05 -04:00
parent 4898c615d6
commit 5041cdf4d9
+15 -12
View File
@@ -2870,19 +2870,22 @@ BMenu::_UpdateWindowViewSize(const bool &move)
screen.Frame().bottom - frame.top);
}
window->AttachScrollers();
if (fLayout == B_ITEMS_IN_COLUMN) {
// we currently only support scrolling for B_ITEMS_IN_COLUMN
window->AttachScrollers();
BMenuItem* selectedItem = FindMarked();
if (selectedItem != NULL && fLayout == B_ITEMS_IN_COLUMN) {
// scroll to the selected item
if (Supermenu() == NULL) {
window->TryScrollTo(selectedItem->Frame().top);
} else {
BPoint point = selectedItem->Frame().LeftTop();
BPoint superpoint = Superitem()->Frame().LeftTop();
Supermenu()->ConvertToScreen(&superpoint);
ConvertToScreen(&point);
window->TryScrollTo(point.y - superpoint.y);
BMenuItem* selectedItem = FindMarked();
if (selectedItem != NULL) {
// scroll to the selected item
if (Supermenu() == NULL) {
window->TryScrollTo(selectedItem->Frame().top);
} else {
BPoint point = selectedItem->Frame().LeftTop();
BPoint superPoint = Superitem()->Frame().LeftTop();
Supermenu()->ConvertToScreen(&superPoint);
ConvertToScreen(&point);
window->TryScrollTo(point.y - superPoint.y);
}
}
}
}