Changeset 88809 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 30, 2021 2:47:36 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144143
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsModel.cpp
r88552 r88809 25 25 26 26 /* GUI includes: */ 27 #include "UICommon.h" 27 28 #include "UIConverter.h" 29 #include "UIDesktopWidgetWatchdog.h" 28 30 #include "UIDetails.h" 29 31 #include "UIDetailsContextMenu.h" 32 #include "UIDetailsElement.h" 33 #include "UIDetailsGroup.h" 30 34 #include "UIDetailsModel.h" 31 #include "UIDetailsGroup.h"32 #include "UIDetailsElement.h"33 35 #include "UIDetailsView.h" 34 36 #include "UIExtraDataManager.h" 35 #include "UICommon.h"36 37 37 38 … … 982 983 983 984 /* Adjust the menu then show it: */ 984 m_pContextMenu->resize(m_pContextMenu->minimumSizeHint()); 985 m_pContextMenu->move(pEvent->screenPos()); 985 const QRect availableGeo = gpDesktop->availableGeometry(pEvent->screenPos()); 986 QRect geo(pEvent->screenPos(), m_pContextMenu->minimumSizeHint()); 987 if (geo.topRight().x() > availableGeo.topRight().x()) 988 geo.adjust(availableGeo.topRight().x() - geo.topRight().x(), 0, 989 availableGeo.topRight().x() - geo.topRight().x(), 0); 990 if (geo.bottomLeft().y() > availableGeo.bottomLeft().y()) 991 geo.adjust(0, availableGeo.bottomLeft().y() - geo.bottomLeft().y(), 992 0, availableGeo.bottomLeft().y() - geo.bottomLeft().y()); 993 m_pContextMenu->resize(geo.size()); 994 m_pContextMenu->move(geo.topLeft()); 986 995 m_pContextMenu->show(); 987 996
Note:
See TracChangeset
for help on using the changeset viewer.