mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-05-19 16:10:35 +00:00
Fix focusing after closing a dialog
This commit is contained in:
@@ -1,17 +1,15 @@
|
|||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import QtQuick.Controls 2.2
|
import QtQuick.Controls 2.3
|
||||||
|
|
||||||
Dialog {
|
Dialog {
|
||||||
// We should use Overlay.overlay here but that's not available in Qt 5.9 :(
|
modal: true
|
||||||
parent: ApplicationWindow.contentItem
|
|
||||||
|
|
||||||
x: Math.round((parent.width - width) / 2)
|
x: Math.round((parent.width - width) / 2)
|
||||||
y: Math.round((parent.height - height) / 2)
|
y: Math.round((parent.height - height) / 2)
|
||||||
|
|
||||||
onAboutToHide: {
|
onClosed: {
|
||||||
// We must force focus back to the last item for platforms without
|
// We must force focus back to the last item. If we don't,
|
||||||
// support for more than one active window like Steam Link. If
|
// gamepad and keyboard navigation will break after a
|
||||||
// we don't, gamepad and keyboard navigation will break after a
|
|
||||||
// dialog appears.
|
// dialog appears.
|
||||||
stackView.forceActiveFocus()
|
stackView.forceActiveFocus()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -289,10 +289,6 @@ CenteredGridView {
|
|||||||
|
|
||||||
NavigableMessageDialog {
|
NavigableMessageDialog {
|
||||||
id: pairDialog
|
id: pairDialog
|
||||||
|
|
||||||
// Pairing dialog must be modal to prevent double-clicks from triggering
|
|
||||||
// pairing twice
|
|
||||||
modal: true
|
|
||||||
closePolicy: Popup.CloseOnEscape
|
closePolicy: Popup.CloseOnEscape
|
||||||
|
|
||||||
// don't allow edits to the rest of the window while open
|
// don't allow edits to the rest of the window while open
|
||||||
|
|||||||
Reference in New Issue
Block a user