Implement quitting Moonlight via gamepad or keyboard. Fixes #100
This commit is contained in:
parent
5df2704ccc
commit
e411c207ae
1 changed files with 20 additions and 0 deletions
|
|
@ -48,12 +48,18 @@ ApplicationWindow {
|
||||||
if (depth > 1) {
|
if (depth > 1) {
|
||||||
stackView.pop()
|
stackView.pop()
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
quitConfirmationDialog.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onBackPressed: {
|
Keys.onBackPressed: {
|
||||||
if (depth > 1) {
|
if (depth > 1) {
|
||||||
stackView.pop()
|
stackView.pop()
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
quitConfirmationDialog.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onMenuPressed: {
|
Keys.onMenuPressed: {
|
||||||
|
|
@ -368,4 +374,18 @@ ApplicationWindow {
|
||||||
Qt.openUrlExternally("https://github.com/moonlight-stream/moonlight-docs/wiki/Gamepad-Mapping");
|
Qt.openUrlExternally("https://github.com/moonlight-stream/moonlight-docs/wiki/Gamepad-Mapping");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This dialog appears when quitting via keyboard or gamepad button
|
||||||
|
MessageDialog {
|
||||||
|
id: quitConfirmationDialog
|
||||||
|
modality:Qt.WindowModal
|
||||||
|
icon: StandardIcon.Warning
|
||||||
|
standardButtons: StandardButton.Yes | StandardButton.No
|
||||||
|
text: "Are you sure you want to quit?"
|
||||||
|
|
||||||
|
onYes: Qt.quit()
|
||||||
|
|
||||||
|
// For keyboard/gamepad navigation
|
||||||
|
onAccepted: Qt.quit()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue