From bb1f233bad35d03c93e737cbcbf6104298dbb498 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Thu, 28 Jan 2021 23:00:33 -0400 Subject: [PATCH] fix: Don't quit the app when clicking on "x" and Enable closing the app with CMD + W Fixes #1694 --- ui/main.qml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ui/main.qml b/ui/main.qml index 5a51091110..69c4002db5 100644 --- a/ui/main.qml +++ b/ui/main.qml @@ -59,6 +59,18 @@ ApplicationWindow { } } + Action { + shortcut: "Ctrl+W" + onTriggered: { + Qt.quit() + } + } + + onClosing: { + applicationWindow.visible = false; + close.accepted = false; + } + Component.onCompleted: { // Change the theme to the system theme (dark/light) until we get the // user's saved setting from status-go (after login) @@ -87,6 +99,19 @@ ApplicationWindow { "shared/img/status-logo.svg" : "shared/img/status-logo-light-theme.svg"; menu: Menu { + MenuItem { + visible: !applicationWindow.visible + text: qsTr("Open Status") + onTriggered: { + applicationWindow.visible = true; + applicationWindow.requestActivate(); + } + } + + MenuSeparator { + visible: !applicationWindow.visible + } + MenuItem { //% "Quit" text: qsTrId("quit")