From 7f7ee8d82f58a8b694085ed38565a611b270ae77 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 21 Mar 2023 16:51:50 +0000 Subject: [PATCH] qml: pressing "Esc" on desktop to ~simulate "back" button --- electrum/gui/qml/components/Pin.qml | 2 +- electrum/gui/qml/components/controls/ElDialog.qml | 2 +- electrum/gui/qml/components/main.qml | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qml/components/Pin.qml b/electrum/gui/qml/components/Pin.qml index 180c4f0c9..1c9f8b724 100644 --- a/electrum/gui/qml/components/Pin.qml +++ b/electrum/gui/qml/components/Pin.qml @@ -23,7 +23,7 @@ ElDialog { focus: true - closePolicy: canCancel ? Popup.CloseOnEscape | Popup.CloseOnPressOutside : Popup.NoAutoClose + closePolicy: canCancel ? Popup.CloseOnPressOutside : Popup.NoAutoClose property bool canCancel: true diff --git a/electrum/gui/qml/components/controls/ElDialog.qml b/electrum/gui/qml/components/controls/ElDialog.qml index 1caa8e71d..71079d7aa 100644 --- a/electrum/gui/qml/components/controls/ElDialog.qml +++ b/electrum/gui/qml/components/controls/ElDialog.qml @@ -19,7 +19,7 @@ Dialog { } closePolicy: allowClose - ? Popup.CloseOnEscape | Popup.CloseOnPressOutside + ? Popup.CloseOnPressOutside : Popup.NoAutoClose onOpenedChanged: { diff --git a/electrum/gui/qml/components/main.qml b/electrum/gui/qml/components/main.qml index dbf6ec4b9..ab5a268a1 100644 --- a/electrum/gui/qml/components/main.qml +++ b/electrum/gui/qml/components/main.qml @@ -430,6 +430,14 @@ ApplicationWindow } } + Shortcut { + context: Qt.ApplicationShortcut + sequence: "Esc" + onActivated: { + close() + } + } + Connections { target: Daemon function onWalletRequiresPassword(name, path) {