mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 22:23:31 +00:00
Fix context menus on Qt 5.9
This commit is contained in:
@@ -134,8 +134,14 @@ GridView {
|
|||||||
acceptedButtons: Qt.RightButton
|
acceptedButtons: Qt.RightButton
|
||||||
onClicked: {
|
onClicked: {
|
||||||
// popup() ensures the menu appears under the mouse cursor
|
// popup() ensures the menu appears under the mouse cursor
|
||||||
|
if (appContextMenu.popup) {
|
||||||
appContextMenu.popup()
|
appContextMenu.popup()
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// Qt 5.9 doesn't have popup()
|
||||||
|
appContextMenu.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onMenuPressed: {
|
Keys.onMenuPressed: {
|
||||||
|
|||||||
@@ -192,8 +192,14 @@ GridView {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
if (!model.addPc) {
|
if (!model.addPc) {
|
||||||
// popup() ensures the menu appears under the mouse cursor
|
// popup() ensures the menu appears under the mouse cursor
|
||||||
|
if (pcContextMenu.popup) {
|
||||||
pcContextMenu.popup()
|
pcContextMenu.popup()
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// Qt 5.9 doesn't have popup()
|
||||||
|
pcContextMenu.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user