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:
+15
-12
@@ -2870,19 +2870,22 @@ BMenu::_UpdateWindowViewSize(const bool &move)
|
|||||||
screen.Frame().bottom - frame.top);
|
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();
|
BMenuItem* selectedItem = FindMarked();
|
||||||
if (selectedItem != NULL && fLayout == B_ITEMS_IN_COLUMN) {
|
if (selectedItem != NULL) {
|
||||||
// scroll to the selected item
|
// scroll to the selected item
|
||||||
if (Supermenu() == NULL) {
|
if (Supermenu() == NULL) {
|
||||||
window->TryScrollTo(selectedItem->Frame().top);
|
window->TryScrollTo(selectedItem->Frame().top);
|
||||||
} else {
|
} else {
|
||||||
BPoint point = selectedItem->Frame().LeftTop();
|
BPoint point = selectedItem->Frame().LeftTop();
|
||||||
BPoint superpoint = Superitem()->Frame().LeftTop();
|
BPoint superPoint = Superitem()->Frame().LeftTop();
|
||||||
Supermenu()->ConvertToScreen(&superpoint);
|
Supermenu()->ConvertToScreen(&superPoint);
|
||||||
ConvertToScreen(&point);
|
ConvertToScreen(&point);
|
||||||
window->TryScrollTo(point.y - superpoint.y);
|
window->TryScrollTo(point.y - superPoint.y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user