mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-11-26 03:46:49 -08:00
Merge branch '2.0'
This commit is contained in:
commit
dc7b6623a9
18 files changed
+196
-26
No files matched your search
+10
-2
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QShortcut>
|
||||
#include <QTimer>
|
||||
|
||||
#include "autotype/AutoType.h"
|
||||
#include "core/Config.h"
|
||||
@@ -449,7 +450,7 @@ void MainWindow::changeEvent(QEvent *event)
|
||||
&& isTrayIconEnabled() && config()->get("GUI/MinimizeToTray").toBool())
|
||||
{
|
||||
event->ignore();
|
||||
hide();
|
||||
QTimer::singleShot(0, this, SLOT(hide()));
|
||||
}
|
||||
else {
|
||||
QMainWindow::changeEvent(event);
|
||||
@@ -575,10 +576,12 @@ void MainWindow::trayIconTriggered(QSystemTrayIcon::ActivationReason reason)
|
||||
|
||||
void MainWindow::toggleWindow()
|
||||
{
|
||||
if (QApplication::activeWindow() == this) {
|
||||
if ((QApplication::activeWindow() == this) && isVisible() && !isMinimized()) {
|
||||
hide();
|
||||
}
|
||||
else {
|
||||
ensurePolished();
|
||||
setWindowState(windowState() & ~Qt::WindowMinimized);
|
||||
show();
|
||||
raise();
|
||||
activateWindow();
|
||||
@@ -597,6 +600,11 @@ void MainWindow::lockDatabasesAfterInactivity()
|
||||
|
||||
bool MainWindow::isTrayIconEnabled() const
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
// systray not useful on OS X
|
||||
return false;
|
||||
#else
|
||||
return config()->get("GUI/ShowTrayIcon").toBool()
|
||||
&& QSystemTrayIcon::isSystemTrayAvailable();
|
||||
#endif
|
||||
}
|
||||
Reference in new issue
Block a user