Skip to content

Commit b4ce19b

Browse files
committed
fix: app doesn't close to tray when [x] is pressed
- hide the window instead of minimizing (except when on macOS or mobile) - hide the advanced "Minimize to tray icon on close" option, making the copy explicitly mention the "tray icon" - fix some runtime warnings Fixes #19364
1 parent 64b6f7b commit b4ce19b

File tree

14 files changed

+51
-33
lines changed

14 files changed

+51
-33
lines changed

storybook/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ int main(int argc, char *argv[])
142142
qInfo() << "Storybook started, Qt runtime version:" << qVersion()
143143
<< "; built against version:" << QLibraryInfo::version().toString()
144144
<< "installed in:" << QLibraryInfo::path(QLibraryInfo::PrefixPath)
145-
<< "; QQC style:" << QQuickStyle::name();
145+
<< "; QQC style:" << QQuickStyle::name()
146+
<< "; QPA:" << qApp->platformName();
146147

147148
return QGuiApplication::exec();
148149
}

ui/app/AppLayouts/Profile/ProfileLayout.qml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ StatusSectionLayout {
7878
property bool isKeycardEnabled: true
7979
property bool isBrowserEnabled: true
8080
required property bool privacyModeFeatureEnabled
81+
required property bool minimizeOnCloseOptionVisible
8182

8283
property var mutualContactsModel
8384
property var blockedContactsModel
@@ -461,6 +462,7 @@ StatusSectionLayout {
461462
walletStore: root.walletStore
462463
isFleetSelectionEnabled: fleetSelectionEnabled
463464
isBrowserEnabled: root.isBrowserEnabled
465+
minimizeOnCloseOptionVisible: root.minimizeOnCloseOptionVisible
464466
sectionTitle: settingsEntriesModel.getNameForSubsection(Constants.settingsSubsection.advanced)
465467
contentWidth: d.contentWidth
466468
}

ui/app/AppLayouts/Profile/views/AdvancedView.qml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ SettingsContentBase {
3838

3939
property bool isFleetSelectionEnabled
4040
property bool isBrowserEnabled: true
41+
property bool minimizeOnCloseOptionVisible
4142

4243
Item {
4344
id: advancedContainer
@@ -73,7 +74,8 @@ SettingsContentBase {
7374

7475
StatusSettingsLineButton {
7576
width: parent.width
76-
text: qsTr("Minimize on close")
77+
visible: root.minimizeOnCloseOptionVisible
78+
text: qsTr("Minimize to tray icon on close")
7779
isSwitch: true
7880
checked: !localAccountSensitiveSettings.quitOnClose
7981
onToggled: localAccountSensitiveSettings.quitOnClose = !checked

ui/app/AppLayouts/Wallet/popups/AddEditSavedAddressPopup.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import QtQuick
2+
import QtQuick.Controls // for Popup.xxx
23

34
import StatusQ.Components
45
import StatusQ.Controls
@@ -389,7 +390,7 @@ StatusDialog {
389390
input.rightPadding: 16
390391
input.tabNavItem: addressInput
391392

392-
onKeyPressed: {
393+
onKeyPressed: event => {
393394
d.submit(event)
394395
}
395396
}

ui/app/AppLayouts/Wallet/views/LeftTabView.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Rectangle {
111111
removeAccountConfirmation.active = true
112112
}
113113

114-
onHideFromTotalBalanceClicked: {
114+
onHideFromTotalBalanceClicked: function (hideFromTotalBalance) {
115115
if (!account)
116116
return
117117
RootStore.updateWatchAccountHiddenFromTotalBalance(account.address, hideFromTotalBalance)
@@ -305,7 +305,7 @@ Rectangle {
305305
errorMode: networkConnectionStore.accountBalanceNotAvailable
306306
errorIcon.tooltip.maxWidth: 300
307307
errorIcon.tooltip.text: networkConnectionStore.accountBalanceNotAvailableText
308-
onClicked: {
308+
onClicked: function(itemId, mouse) {
309309
if (mouse.button === Qt.RightButton) {
310310
walletAccountContextMenu.active = true
311311
walletAccountContextMenu.item.account = model

ui/app/mainui/AppMain.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ Item {
139139

140140
required property bool isCentralizedMetricsEnabled
141141

142+
required property bool systemTrayIconAvailable
143+
142144
function showEnableBiometricsFlow() {
143145
popupRequestsHandler.enableBiometricsPopupHandler.openPopup()
144146
}
@@ -2137,6 +2139,7 @@ Item {
21372139
isKeycardEnabled: featureFlagsStore.keycardEnabled
21382140
isBrowserEnabled: featureFlagsStore.browserEnabled
21392141
privacyModeFeatureEnabled: featureFlagsStore.privacyModeFeatureEnabled
2142+
minimizeOnCloseOptionVisible: appMain.systemTrayIconAvailable
21402143

21412144
theme: appMainLocalSettings.theme
21422145
fontSize: appMainLocalSettings.fontSize

ui/i18n/qml_base_en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@
11951195
<translation type="unfinished"></translation>
11961196
</message>
11971197
<message>
1198-
<source>Minimize on close</source>
1198+
<source>Minimize to tray icon on close</source>
11991199
<translation type="unfinished"></translation>
12001200
</message>
12011201
<message>

ui/i18n/qml_base_lokalise_en.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,9 +1459,9 @@
14591459
<translation>System</translation>
14601460
</message>
14611461
<message>
1462-
<source>Minimize on close</source>
1462+
<source>Minimize to tray icon on close</source>
14631463
<comment>AdvancedView</comment>
1464-
<translation>Minimize on close</translation>
1464+
<translation>Minimize to tray icon on close</translation>
14651465
</message>
14661466
<message>
14671467
<source>Mainnet data verified by Nimbus</source>

ui/i18n/qml_cs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@
11981198
<translation type="unfinished">Systémový</translation>
11991199
</message>
12001200
<message>
1201-
<source>Minimize on close</source>
1201+
<source>Minimize to tray icon on close</source>
12021202
<translation type="unfinished"></translation>
12031203
</message>
12041204
<message>

ui/i18n/qml_es.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,8 +1195,8 @@
11951195
<translation>Sistema</translation>
11961196
</message>
11971197
<message>
1198-
<source>Minimize on close</source>
1199-
<translation>Minimizar al cerrar</translation>
1198+
<source>Minimize to tray icon on close</source>
1199+
<translation type="unfinished"></translation>
12001200
</message>
12011201
<message>
12021202
<source>Mainnet data verified by Nimbus</source>

0 commit comments

Comments
 (0)