if (conf()->get(Config::lockOnMinimize).toBool()) {
this->lockWallet();
}
+ if (conf()->get(Config::showTrayIcon).toBool() && conf()->get(Config::minimizeToTray).toBool()) {
+ this->hide();
+ }
} else {
QMainWindow::changeEvent(event);
}
conf()->set(Config::hideNotifications, toggled);
});
- // [Hide tray icon]
- ui->checkBox_hideTrayIcon->setChecked(conf()->get(Config::hideTrayIcon).toBool());
- connect(ui->checkBox_hideTrayIcon, &QCheckBox::toggled, [this](bool toggled) {
- conf()->set(Config::hideTrayIcon, toggled);
- emit hideTrayIcon(toggled);
- });
-
// [Warn before opening external link]
ui->checkBox_warnOnExternalLink->setChecked(conf()->get(Config::warnOnExternalLink).toBool());
connect(ui->checkBox_warnOnExternalLink, &QCheckBox::clicked, this, [this]{
connect(ui->checkBox_lockOnMinimize, &QCheckBox::toggled, [](bool toggled){
conf()->set(Config::lockOnMinimize, toggled);
});
+
+ // [Show tray icon]
+ ui->checkBox_showTrayIcon->setChecked(conf()->get(Config::showTrayIcon).toBool());
+ connect(ui->checkBox_showTrayIcon, &QCheckBox::toggled, [this](bool toggled) {
+ conf()->set(Config::showTrayIcon, toggled);
+ ui->checkBox_minimizeToTray->setEnabled(toggled);
+ emit showTrayIcon(toggled);
+ });
+
+ // [Hide window to system tray when minimized]
+ ui->checkBox_minimizeToTray->setEnabled(ui->checkBox_showTrayIcon->isChecked());
+ ui->checkBox_minimizeToTray->setChecked(conf()->get(Config::minimizeToTray).toBool());
+ connect(ui->checkBox_minimizeToTray, &QCheckBox::toggled, [this](bool toggled) {
+ conf()->set(Config::minimizeToTray, toggled);
+ });
}
void Settings::setupMemoryTab() {
void preferredFiatCurrencyChanged(QString currency);
void skinChanged(QString skinName);
void hideUpdateNotifications(bool hidden);
- void hideTrayIcon(bool hidden);
+ void showTrayIcon(bool visible);
void websocketStatusChanged(bool enabled);
void proxySettingsChanged();
void updateBalance();
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
- <layout class="QVBoxLayout" name="verticalLayout_19" stretch="1,1,1,0,1,1,1">
+ <layout class="QVBoxLayout" name="verticalLayout_19" stretch="1,1,1,1,1,0,0,0">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
</item>
</layout>
</item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_13">
- <item>
- <widget class="QCheckBox" name="checkBox_hideTrayIcon">
- <property name="text">
- <string>Hide tray icon</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
</item>
</layout>
</item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_13">
+ <item>
+ <widget class="QCheckBox" name="checkBox_showTrayIcon">
+ <property name="text">
+ <string>Show tray icon</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_16">
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Orientation::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Policy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>30</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBox_minimizeToTray">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Hide window to system tray when minimized</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</item>
<item>
m_tray = new QSystemTrayIcon(icons()->icon("appicons/64x64.png"));
m_tray->setToolTip("Feather Wallet");
this->buildTrayMenu();
- m_tray->setVisible(!conf()->get(Config::hideTrayIcon).toBool());
+ m_tray->setVisible(conf()->get(Config::showTrayIcon).toBool());
this->initSkins();
this->patchMacStylesheet();
window->onHideUpdateNotifications(hidden);
}
});
- connect(&settings, &Settings::hideTrayIcon, [this](bool hidden) {
- m_tray->setVisible(!hidden);
+ connect(&settings, &Settings::showTrayIcon, [this](bool visible) {
+ m_tray->setVisible(visible);
});
connect(&settings, &Settings::pluginConfigured, [this](const QString &id) {
emit pluginConfigured(id);
{Config::inactivityLockEnabled, {QS("inactivityLockEnabled"), false}},
{Config::inactivityLockTimeout, {QS("inactivityLockTimeout"), 10}},
{Config::lockOnMinimize, {QS("lockOnMinimize"), false}},
+ {Config::showTrayIcon, {QS("showTrayIcon"), true}},
+ {Config::minimizeToTray, {QS("minimizeToTray"), false}},
{Config::disableWebsocket, {QS("disableWebsocket"), false}},
{Config::offlineMode, {QS("offlineMode"), false}},
{Config::hideBalance, {QS("hideBalance"), false}},
{Config::hideNotifications, {QS("hideNotifications"), false}},
{Config::hideUpdateNotifications, {QS("hideUpdateNotifications"), false}},
- {Config::hideTrayIcon, {QS("hideTrayIcon"), false}},
{Config::disableLogging, {QS("disableLogging"), true}},
{Config::writeStackTraceToDisk, {QS("writeStackTraceToDisk"), true}},
{Config::writeRecentlyOpenedWallets, {QS("writeRecentlyOpenedWallets"), true}},
hideBalance,
hideUpdateNotifications,
hideNotifications,
- hideTrayIcon,
warnOnExternalLink,
inactivityLockEnabled,
inactivityLockTimeout,
lockOnMinimize,
+ showTrayIcon,
+ minimizeToTray,
// Transactions
multiBroadcast,