Fix positioning of context menus under Wayland
Does not cover positioning the tray widget itself yet.
This commit is contained in:
parent
2c95a15f1a
commit
f4097d3d79
|
@ -41,7 +41,7 @@ void DevView::mouseReleaseEvent(QMouseEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
void DevView::showContextMenu()
|
||||
void DevView::showContextMenu(const QPoint &position)
|
||||
{
|
||||
if (selectionModel() && selectionModel()->selectedRows(0).size() == 1) {
|
||||
QMenu menu;
|
||||
|
@ -60,7 +60,7 @@ void DevView::showContextMenu()
|
|||
tr("Copy ID")),
|
||||
&QAction::triggered, this, &DevView::copySelectedItemId);
|
||||
}
|
||||
menu.exec(QCursor::pos());
|
||||
menu.exec(mapToGlobal(position));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ protected:
|
|||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void showContextMenu();
|
||||
void showContextMenu(const QPoint &position);
|
||||
void copySelectedItem();
|
||||
void copySelectedItemId();
|
||||
};
|
||||
|
|
|
@ -70,7 +70,7 @@ void DirView::mouseReleaseEvent(QMouseEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
void DirView::showContextMenu()
|
||||
void DirView::showContextMenu(const QPoint &position)
|
||||
{
|
||||
if (selectionModel() && selectionModel()->selectedRows(0).size() == 1) {
|
||||
QMenu menu;
|
||||
|
@ -89,7 +89,7 @@ void DirView::showContextMenu()
|
|||
tr("Copy path")),
|
||||
&QAction::triggered, this, &DirView::copySelectedItemPath);
|
||||
}
|
||||
menu.exec(QCursor::pos());
|
||||
menu.exec(mapToGlobal(position));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ protected:
|
|||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void showContextMenu();
|
||||
void showContextMenu(const QPoint &position);
|
||||
void copySelectedItem();
|
||||
void copySelectedItemPath();
|
||||
};
|
||||
|
|
|
@ -47,7 +47,7 @@ void DownloadView::mouseReleaseEvent(QMouseEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
void DownloadView::showContextMenu()
|
||||
void DownloadView::showContextMenu(const QPoint &position)
|
||||
{
|
||||
if (selectionModel() && selectionModel()->selectedRows(0).size() == 1) {
|
||||
QMenu menu;
|
||||
|
@ -62,7 +62,7 @@ void DownloadView::showContextMenu()
|
|||
tr("Copy label/ID")),
|
||||
&QAction::triggered, this, &DownloadView::copySelectedItem);
|
||||
}
|
||||
menu.exec(QCursor::pos());
|
||||
menu.exec(mapToGlobal(position));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ protected:
|
|||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void showContextMenu();
|
||||
void showContextMenu(const QPoint &position);
|
||||
void copySelectedItem();
|
||||
};
|
||||
} // namespace QtGui
|
||||
|
|
Loading…
Reference in New Issue