fix: Don't quit the app when clicking on "x" and Enable closing the app with CMD + W

Fixes #1694
This commit is contained in:
Richard Ramos 2021-01-28 23:00:33 -04:00 committed by Iuri Matias
parent 98b3e64573
commit bb1f233bad
1 changed files with 25 additions and 0 deletions

View File

@ -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")