Adding escape shortcut for base dialog.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adsooi 2023-05-24 09:58:58 +02:00
parent 40743e54c3
commit 09c1a44150
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160

View file

@ -28,6 +28,7 @@ import QtQuick.Controls
*/ */
Window { Window {
id: base
color: sysPalette.window color: sysPalette.window
visible: false; visible: false;
flags: Qt.Dialog | Qt.Popup | Qt.MSWindowsFixedSizeDialogHint flags: Qt.Dialog | Qt.Popup | Qt.MSWindowsFixedSizeDialogHint
@ -35,7 +36,6 @@ Window {
minimumWidth: width minimumWidth: width
maximumWidth: width maximumWidth: width
height: minimumHeight height: minimumHeight
// maximumHeight: contentItem.implicitHeight + 2*margin
property int margin: 10 property int margin: 10
Button { Button {
@ -48,6 +48,11 @@ Window {
onClicked: close() onClicked: close()
} }
Shortcut {
sequence: "Esc"
onActivated: base.close()
}
function open() { function open() {
show() show()
} }