From fd8a84eb9de35f56ffe7912123dc721183a49773 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Mon, 22 Feb 2021 18:10:47 -0400 Subject: [PATCH] fix: minimize on close --- .../AppLayouts/Profile/Sections/AdvancedContainer.qml | 9 +++++++++ ui/app/AppMain.qml | 1 + ui/main.qml | 11 +++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ui/app/AppLayouts/Profile/Sections/AdvancedContainer.qml b/ui/app/AppLayouts/Profile/Sections/AdvancedContainer.qml index fbd4cb1f84..a9114e113f 100644 --- a/ui/app/AppLayouts/Profile/Sections/AdvancedContainer.qml +++ b/ui/app/AppLayouts/Profile/Sections/AdvancedContainer.qml @@ -34,6 +34,15 @@ Item { onClicked: fleetModal.open() } + StatusSettingsLineButton { + text: qsTr("Minimize on close") + isSwitch: true + switchChecked: !appSettings.quitOnClose + onClicked: function (checked) { + appSettings.quitOnClose = !checked + } + } + Item { id: spacer1 height: Style.current.bigPadding diff --git a/ui/app/AppMain.qml b/ui/app/AppMain.qml index c6a44888fe..3368c147f9 100644 --- a/ui/app/AppMain.qml +++ b/ui/app/AppMain.qml @@ -102,6 +102,7 @@ RowLayout { property int fontSize: Constants.fontSizeM property bool hideSignPhraseModal: false property bool onlyShowContactsProfilePics: true + property bool quitOnClose: true // Browser settings property bool showBrowserSelector: true diff --git a/ui/main.qml b/ui/main.qml index a928f5cbbf..f89d764232 100644 --- a/ui/main.qml +++ b/ui/main.qml @@ -74,8 +74,14 @@ ApplicationWindow { } onClosing: { - applicationWindow.visible = false; - close.accepted = false; + if(loader.sourceComponent == app){ + if(loader.item.appSettings.quitOnClose){ + Qt.quit(); + } else { + applicationWindow.visible = false; + close.accepted = false; + } + } } Component.onCompleted: { @@ -234,6 +240,7 @@ ApplicationWindow { Loader { id: loader anchors.fill: parent + property var appSettings } Component {