mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-15 21:22:40 +00:00
Add long press action on PC view for touchscreens
This commit is contained in:
+14
-10
@@ -186,20 +186,24 @@ GridView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onPressAndHold: {
|
||||||
|
if (!model.addPc) {
|
||||||
|
// popup() ensures the menu appears under the mouse cursor
|
||||||
|
if (pcContextMenu.popup) {
|
||||||
|
pcContextMenu.popup()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Qt 5.9 doesn't have popup()
|
||||||
|
pcContextMenu.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.RightButton;
|
acceptedButtons: Qt.RightButton;
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!model.addPc) {
|
parent.onPressAndHold()
|
||||||
// popup() ensures the menu appears under the mouse cursor
|
|
||||||
if (pcContextMenu.popup) {
|
|
||||||
pcContextMenu.popup()
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Qt 5.9 doesn't have popup()
|
|
||||||
pcContextMenu.open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user