QMenu: Adjust the position of the submenu
When the submenu is about to exceed the screen, set the position of the submenu to the left border of the main menu Fixes: QTBUG-104050 Change-Id: I8935f1bfceb93cfa1097391689f4233991394978 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>bb10
parent
e35fc908fd
commit
e57ab1b454
|
|
@ -3579,7 +3579,7 @@ void QMenu::internalDelayedPopup()
|
|||
const QRect actionRect(d->actionRect(d->currentAction));
|
||||
QPoint subMenuPos(mapToGlobal(QPoint(actionRect.right() + subMenuOffset + 1, actionRect.top())));
|
||||
if (subMenuPos.x() > screen.right())
|
||||
subMenuPos.setX(QCursor::pos().x());
|
||||
subMenuPos.setX(geometry().left());
|
||||
|
||||
const auto &subMenuActions = d->activeMenu->actions();
|
||||
if (!subMenuActions.isEmpty()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue