mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-03-04 14:47:18 +00:00
Fix error dialog focus issues after dismissal on Steam Link
This commit is contained in:
parent
1d94903eef
commit
81ad1a18fa
7 changed files with 36 additions and 8 deletions
|
@ -214,7 +214,7 @@ GridView {
|
|||
}
|
||||
}
|
||||
|
||||
MessageDialog {
|
||||
NavigableMessageDialog {
|
||||
id: quitAppDialog
|
||||
modality:Qt.WindowModal
|
||||
property string appName : ""
|
||||
|
|
|
@ -78,7 +78,7 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
MessageDialog {
|
||||
NavigableMessageDialog {
|
||||
id: quitAppDialog
|
||||
modality:Qt.WindowModal
|
||||
text:"Are you sure you want to quit " + appName +"? Any unsaved progress will be lost."
|
||||
|
|
|
@ -3,7 +3,7 @@ import QtQuick.Dialogs 1.2
|
|||
|
||||
import SystemProperties 1.0
|
||||
|
||||
MessageDialog {
|
||||
NavigableMessageDialog {
|
||||
property string helpText
|
||||
|
||||
informativeText: SystemProperties.hasBrowser ? helpText : ""
|
||||
|
|
21
app/gui/NavigableMessageDialog.qml
Normal file
21
app/gui/NavigableMessageDialog.qml
Normal file
|
@ -0,0 +1,21 @@
|
|||
import QtQuick 2.0
|
||||
import QtQuick.Dialogs 1.2
|
||||
|
||||
MessageDialog {
|
||||
property Item originalFocusItem
|
||||
|
||||
onVisibleChanged: {
|
||||
if (!isWindow) {
|
||||
if (visible) {
|
||||
originalFocusItem = window.activeFocusItem
|
||||
}
|
||||
else {
|
||||
// We must force focus back to the last item for platforms without
|
||||
// support for more than one active window like Steam Link. If
|
||||
// we don't, gamepad and keyboard navigation will break after a
|
||||
// dialog appears.
|
||||
originalFocusItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -238,7 +238,7 @@ GridView {
|
|||
}
|
||||
}
|
||||
|
||||
MessageDialog {
|
||||
NavigableMessageDialog {
|
||||
id: pairDialog
|
||||
// don't allow edits to the rest of the window while open
|
||||
modality:Qt.WindowModal
|
||||
|
@ -250,7 +250,7 @@ GridView {
|
|||
}
|
||||
}
|
||||
|
||||
MessageDialog {
|
||||
NavigableMessageDialog {
|
||||
id: deletePcDialog
|
||||
// don't allow edits to the rest of the window while open
|
||||
modality:Qt.WindowModal
|
||||
|
|
|
@ -230,7 +230,13 @@ ApplicationWindow {
|
|||
ToolTip.delay: 1000
|
||||
ToolTip.timeout: 3000
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.text: "Add a new PC manually"
|
||||
ToolTip.text: "Add PC manually" + (newPcShortcut.nativeText ? (" ("+newPcShortcut.nativeText+")") : "")
|
||||
|
||||
Shortcut {
|
||||
id: newPcShortcut
|
||||
sequence: StandardKey.New
|
||||
onActivated: addPcButton.clicked()
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
addPcDialog.open()
|
||||
|
@ -393,7 +399,7 @@ ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
MessageDialog {
|
||||
NavigableMessageDialog {
|
||||
id: wow64Dialog
|
||||
icon: StandardIcon.Warning
|
||||
standardButtons: StandardButton.Ok | StandardButton.Cancel
|
||||
|
@ -415,7 +421,7 @@ ApplicationWindow {
|
|||
}
|
||||
|
||||
// This dialog appears when quitting via keyboard or gamepad button
|
||||
MessageDialog {
|
||||
NavigableMessageDialog {
|
||||
id: quitConfirmationDialog
|
||||
icon: StandardIcon.Warning
|
||||
standardButtons: StandardButton.Yes | StandardButton.No
|
||||
|
|
|
@ -15,5 +15,6 @@
|
|||
<file>gui/AutoResizingComboBox.qml</file>
|
||||
<file>gui/NavigableMenu.qml</file>
|
||||
<file>gui/ErrorMessageDialog.qml</file>
|
||||
<file>gui/NavigableMessageDialog.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
Loading…
Add table
Reference in a new issue