Fix minimize at startup and decouple various tray and minimization options (#109)
* Hide window on startup when configured to start minimized, fixes #105 * Decouple different systray and minimization options, fixes #64 * Commit missing changes in main.cpp to minimize at startup * Remove obsolete code
This commit is contained in:
committed by
Jonathan White
parent
02d2ac904d
commit
19a960856c
@@ -329,14 +329,12 @@ void MainWindow::openDatabase(const QString& fileName, const QString& pw, const
|
||||
m_ui->tabWidget->openDatabase(fileName, pw, keyFile);
|
||||
}
|
||||
|
||||
void MainWindow::configuredMinimizeWindow()
|
||||
void MainWindow::minimizeWindow()
|
||||
{
|
||||
bool minimize = isTrayIconEnabled() &&
|
||||
config()->get("GUI/MinimizeToTray").toBool() &&
|
||||
config()->get("GUI/MinimizeOnClose").toBool() &&
|
||||
config()->get("GUI/MinimizeOnStartup").toBool();
|
||||
if (minimize) {
|
||||
if (isTrayIconEnabled() && config()->get("GUI/MinimizeToTray").toBool()) {
|
||||
hide();
|
||||
} else {
|
||||
setWindowState(Qt::WindowMinimized);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -523,7 +521,6 @@ void MainWindow::databaseTabChanged(int tabIndex)
|
||||
void MainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
bool minimizeOnClose = isTrayIconEnabled() &&
|
||||
config()->get("GUI/MinimizeToTray").toBool() &&
|
||||
config()->get("GUI/MinimizeOnClose").toBool();
|
||||
if (minimizeOnClose && !appExitCalled)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user