mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-10-15 23:10:59 -04:00
Merge branch '2.0'
This commit is contained in:
commit
dc7b6623a9
18 changed files with 197 additions and 27 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue