feat: hide to tray on closing
This commit is contained in:
parent
645b92ba51
commit
93e6af3e20
5 changed files with 82 additions and 20 deletions
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "pagegeneral.h"
|
||||
#include "ui_pagegeneral.h"
|
||||
#include "ui/squawk.h"
|
||||
|
||||
PageGeneral::PageGeneral(QWidget* parent):
|
||||
QWidget(parent),
|
||||
|
@ -28,7 +29,10 @@ PageGeneral::PageGeneral(QWidget* parent):
|
|||
|
||||
QSettings settings;
|
||||
m_ui->downloadsPathInput->setText(settings.value("downloadsPath").toString());
|
||||
m_ui->trayIconCheckbox->setChecked(settings.value("trayIconCheckbox").toBool());
|
||||
|
||||
connect(m_ui->downloadsPathButton, &QPushButton::clicked, this, &PageGeneral::onBrowseButtonClicked);
|
||||
connect(m_ui->trayIconCheckbox, &QCheckBox::stateChanged, this, &PageGeneral::onTrayIconCheckboxChecked);
|
||||
}
|
||||
|
||||
PageGeneral::~PageGeneral()
|
||||
|
@ -76,3 +80,9 @@ void PageGeneral::onDialogDestroyed()
|
|||
{
|
||||
dialog = nullptr;
|
||||
}
|
||||
|
||||
void PageGeneral::onTrayIconCheckboxChecked(){
|
||||
QSettings settings;
|
||||
settings.setValue("trayIconCheckbox", m_ui->trayIconCheckbox->isChecked());
|
||||
Squawk::trayIcon->setVisible(m_ui->trayIconCheckbox->isChecked());
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ private slots:
|
|||
void onBrowseButtonClicked();
|
||||
void onDialogAccepted();
|
||||
void onDialogDestroyed();
|
||||
void onTrayIconCheckboxChecked();
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::PageGeneral> m_ui;
|
||||
|
|
|
@ -39,6 +39,19 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="trayIconCheckbox">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hide Squawk to tray</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue