mirror of
https://github.com/feather-wallet/feather.git
synced 2025-04-16 18:01:54 +00:00
settings: add option to hide tray icon
This commit is contained in:
parent
3fa9240c0b
commit
88ab38a193
6 changed files with 54 additions and 30 deletions
|
@ -286,6 +286,13 @@ void Settings::setupDisplayTab() {
|
|||
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]{
|
||||
|
|
|
@ -36,6 +36,7 @@ signals:
|
|||
void preferredFiatCurrencyChanged(QString currency);
|
||||
void skinChanged(QString skinName);
|
||||
void hideUpdateNotifications(bool hidden);
|
||||
void hideTrayIcon(bool hidden);
|
||||
void websocketStatusChanged(bool enabled);
|
||||
void proxySettingsChanged();
|
||||
void updateBalance();
|
||||
|
|
|
@ -55,10 +55,10 @@
|
|||
<item>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
|
@ -142,7 +142,7 @@
|
|||
<item row="7" column="0">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -264,10 +264,10 @@
|
|||
<item>
|
||||
<spacer name="verticalSpacer_11">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Maximum</enum>
|
||||
<enum>QSizePolicy::Policy::Maximum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -287,7 +287,7 @@
|
|||
<item>
|
||||
<spacer name="verticalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -314,7 +314,7 @@
|
|||
<item>
|
||||
<spacer name="verticalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -368,10 +368,10 @@
|
|||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
<enum>QFormLayout::FieldGrowthPolicy::ExpandingFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="rowWrapPolicy">
|
||||
<enum>QFormLayout::DontWrapRows</enum>
|
||||
<enum>QFormLayout::RowWrapPolicy::DontWrapRows</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_22">
|
||||
|
@ -458,10 +458,10 @@
|
|||
<item>
|
||||
<widget class="QFrame" name="frame_portableMode">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
<enum>QFrame::Shape::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<property name="leftMargin">
|
||||
|
@ -489,7 +489,7 @@
|
|||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -564,7 +564,7 @@
|
|||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -586,7 +586,7 @@
|
|||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -615,7 +615,7 @@
|
|||
<item>
|
||||
<spacer name="verticalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -664,14 +664,14 @@
|
|||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_11">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_19" stretch="1,1,1,1,1,1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_19" stretch="1,1,1,0,1,1,1">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
|
@ -723,6 +723,17 @@
|
|||
</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>
|
||||
|
@ -802,7 +813,7 @@
|
|||
<item>
|
||||
<spacer name="verticalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -844,10 +855,10 @@
|
|||
<item>
|
||||
<widget class="QFrame" name="frame_4">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_17">
|
||||
<item>
|
||||
|
@ -860,7 +871,7 @@
|
|||
<item>
|
||||
<spacer name="verticalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -902,10 +913,10 @@
|
|||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
|
@ -936,7 +947,7 @@
|
|||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -979,7 +990,7 @@
|
|||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -1077,7 +1088,7 @@
|
|||
<item>
|
||||
<spacer name="verticalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -1100,10 +1111,10 @@
|
|||
<item>
|
||||
<widget class="QDialogButtonBox" name="closeButton">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -45,7 +45,7 @@ WindowManager::WindowManager(QObject *parent)
|
|||
m_tray = new QSystemTrayIcon(icons()->icon("appicons/64x64.png"));
|
||||
m_tray->setToolTip("Feather Wallet");
|
||||
this->buildTrayMenu();
|
||||
m_tray->show();
|
||||
m_tray->setVisible(!conf()->get(Config::hideTrayIcon).toBool());
|
||||
|
||||
this->initSkins();
|
||||
this->patchMacStylesheet();
|
||||
|
@ -194,6 +194,9 @@ void WindowManager::showSettings(Nodes *nodes, QWidget *parent, bool showProxyTa
|
|||
window->onHideUpdateNotifications(hidden);
|
||||
}
|
||||
});
|
||||
connect(&settings, &Settings::hideTrayIcon, [this](bool hidden) {
|
||||
m_tray->setVisible(!hidden);
|
||||
});
|
||||
connect(&settings, &Settings::pluginConfigured, [this](const QString &id) {
|
||||
emit pluginConfigured(id);
|
||||
});
|
||||
|
|
|
@ -98,6 +98,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
|
|||
{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}},
|
||||
|
|
|
@ -113,6 +113,7 @@ public:
|
|||
hideBalance,
|
||||
hideUpdateNotifications,
|
||||
hideNotifications,
|
||||
hideTrayIcon,
|
||||
warnOnExternalLink,
|
||||
inactivityLockEnabled,
|
||||
inactivityLockTimeout,
|
||||
|
|
Loading…
Reference in a new issue