mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-28 16:59:44 -05:00
Improve minimize to tray
This commit is contained in:
parent
d1b403333c
commit
38d64a34a1
@ -554,7 +554,7 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
||||
if (minimizeOnClose && !appExitCalled)
|
||||
{
|
||||
event->ignore();
|
||||
hide();
|
||||
toggleWindow();
|
||||
|
||||
if (config()->get("security/lockdatabaseminimize").toBool()) {
|
||||
m_ui->tabWidget->lockDatabases();
|
||||
@ -722,6 +722,7 @@ void MainWindow::trayIconTriggered(QSystemTrayIcon::ActivationReason reason)
|
||||
void MainWindow::toggleWindow()
|
||||
{
|
||||
if ((QApplication::activeWindow() == this) && isVisible() && !isMinimized()) {
|
||||
setWindowState(windowState() | Qt::WindowMinimized);
|
||||
hide();
|
||||
|
||||
if (config()->get("security/lockdatabaseminimize").toBool()) {
|
||||
@ -730,8 +731,8 @@ void MainWindow::toggleWindow()
|
||||
}
|
||||
else {
|
||||
ensurePolished();
|
||||
setWindowState(windowState() & ~Qt::WindowMinimized);
|
||||
show();
|
||||
setWindowState(windowState() & ~Qt::WindowMinimized);
|
||||
raise();
|
||||
activateWindow();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user