Fixed popup menus opened at the wrong position (mostly noticed in Installer) with a horrible hack which I can't see how to avoid

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15941 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2006-01-13 20:48:48 +00:00
parent 89fb2ae90c
commit fc3a8a1c73
+6 -1
View File
@@ -19,6 +19,7 @@
#include <Screen.h> #include <Screen.h>
#include <Window.h> #include <Window.h>
#include <BMCPrivate.h>
#include <MenuPrivate.h> #include <MenuPrivate.h>
#include <MenuWindow.h> #include <MenuWindow.h>
@@ -1429,7 +1430,11 @@ BMenu::CalcFrame(BPoint where, bool *scrollOn)
BMenu *superMenu = Supermenu(); BMenu *superMenu = Supermenu();
BMenuItem *superItem = Superitem(); BMenuItem *superItem = Superitem();
if (superMenu == NULL || superItem == NULL) { // TODO: Horrible hack:
// When added to a BMenuField, a BPopUpMenu is the child of
// a _BMCItem_ inside a _BMCMenuBar_ to "fake" the menu hierarchy
if (superMenu == NULL || superItem == NULL
|| dynamic_cast<_BMCItem_ *>(superItem) != NULL) {
// just move the window on screen // just move the window on screen
if (frame.bottom > screenFrame.bottom) if (frame.bottom > screenFrame.bottom)