Interface Kit: fix menu resizing when scrolling is enabled

BMenuWindow::Attach/DetachScrollers can be called when scrollers are
already attached/detached and it should handle this case properly.

Call BMenuWindow::DetachScrollers when scrolling is not needed anymore.

Fixes #8513.

Change-Id: I1f70b63d75106cf33ab1f72d34e221a54b45a75e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2310
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: John Scipione <[email protected]>
This commit is contained in:
X512
2020-03-07 17:33:25 +00:00
committed by waddlesplash
parent 30f2ededbf
commit 9b33a309da
2 changed files with 27 additions and 7 deletions
+3
View File
@@ -2931,6 +2931,9 @@ BMenu::_UpdateWindowViewSize(const bool &move)
if (fItems.CountItems() > 0) {
if (!scroll) {
if (fLayout == B_ITEMS_IN_COLUMN)
window->DetachScrollers();
window->ResizeTo(Bounds().Width(), Bounds().Height());
} else {
BScreen screen(window);