mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Merge pull request #582 from weslly/feature/macos-minimize-onclose
Fix quit submenu on macOS tray icon
This commit is contained in:
commit
07d4668670
@ -747,10 +747,17 @@ void MainWindow::updateTrayIcon()
|
|||||||
QAction* actionToggle = new QAction(tr("Toggle window"), menu);
|
QAction* actionToggle = new QAction(tr("Toggle window"), menu);
|
||||||
menu->addAction(actionToggle);
|
menu->addAction(actionToggle);
|
||||||
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
QAction* actionQuit = new QAction(tr("Quit KeePassXC"), menu);
|
||||||
|
menu->addAction(actionQuit);
|
||||||
|
|
||||||
|
connect(actionQuit, SIGNAL(triggered()), SLOT(appExit()));
|
||||||
|
#else
|
||||||
menu->addAction(m_ui->actionQuit);
|
menu->addAction(m_ui->actionQuit);
|
||||||
|
|
||||||
connect(m_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
|
connect(m_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
|
||||||
SLOT(trayIconTriggered(QSystemTrayIcon::ActivationReason)));
|
SLOT(trayIconTriggered(QSystemTrayIcon::ActivationReason)));
|
||||||
|
#endif
|
||||||
connect(actionToggle, SIGNAL(triggered()), SLOT(toggleWindow()));
|
connect(actionToggle, SIGNAL(triggered()), SLOT(toggleWindow()));
|
||||||
|
|
||||||
m_trayIcon->setContextMenu(menu);
|
m_trayIcon->setContextMenu(menu);
|
||||||
|
Loading…
Reference in New Issue
Block a user