Skip to content

Commit

Permalink
qml: pressing "Esc" on desktop to ~simulate "back" button
Browse files Browse the repository at this point in the history
  • Loading branch information
SomberNight committed Mar 21, 2023
1 parent 9830466 commit 7f7ee8d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion electrum/gui/qml/components/Pin.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion electrum/gui/qml/components/controls/ElDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Dialog {
}

closePolicy: allowClose
? Popup.CloseOnEscape | Popup.CloseOnPressOutside
? Popup.CloseOnPressOutside
: Popup.NoAutoClose

onOpenedChanged: {
Expand Down
8 changes: 8 additions & 0 deletions electrum/gui/qml/components/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,14 @@ ApplicationWindow
}
}

Shortcut {
context: Qt.ApplicationShortcut
sequence: "Esc"
onActivated: {
close()
}
}

Connections {
target: Daemon
function onWalletRequiresPassword(name, path) {
Expand Down

0 comments on commit 7f7ee8d

Please sign in to comment.