diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index dabc56da6..01d4c08b8 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -307,6 +307,17 @@ void MainWindow::openDatabase(const QString& fileName, const QString& pw, const m_ui->tabWidget->openDatabase(fileName, pw, keyFile); } +void MainWindow::configuredMinimizeWindow() +{ + bool minimize = isTrayIconEnabled() && + config()->get("GUI/MinimizeToTray").toBool() && + config()->get("GUI/MinimizeOnClose").toBool() && + config()->get("GUI/MinimizeOnStartup").toBool(); + if (minimize) { + hide(); + } +} + void MainWindow::setMenuActionState(DatabaseWidget::Mode mode) { bool inDatabaseTabWidget = (m_ui->stackedWidget->currentIndex() == 0); diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h index 0bdb1b828..4d2ebb8cd 100644 --- a/src/gui/MainWindow.h +++ b/src/gui/MainWindow.h @@ -38,6 +38,7 @@ class MainWindow : public QMainWindow public: MainWindow(); ~MainWindow(); + void configuredMinimizeWindow(); public Q_SLOTS: void openDatabase(const QString& fileName, const QString& pw = QString(),