settings: add option to minimize to tray

This commit is contained in:
tobtoht
2025-03-04 15:31:34 +01:00
parent e55afe9429
commit bb1015731f
7 changed files with 68 additions and 25 deletions
+15 -7
View File
@@ -286,13 +286,6 @@ 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]{
@@ -315,6 +308,21 @@ void Settings::setupDisplayTab() {
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() {