FR: popupmenus that prefer to pop upwards

I have a plugin GUI with some combo boxes and buttons that trigger popup menus near the bottom of the GUI. The Juce popups always pop up downwards unless the window is near the bottom of the screen. I very much would like to be able to change this behaviour with an option to make them pop upwards. In the Juce code that would only need one or two lines of change. I went through a lot of trouble to create a half working workaround, but due to how PopupMenus work internally, it’s a bit crazy. All that would be needed for a clean solution was an additional boolean PopupMenu::Options variant to indicate a menu that prefers going upwards and a minor change in MenuWindow::calculateWindowPos where it decides when to go upwards currently hardcoded to some distance to the bottom of the parent area.

1 Like

Thank you very much for the patch!