mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-23 00:10:37 -05:00
Added dark tray icon parameter to settings.
This commit is contained in:
parent
f80b5af432
commit
55271311c4
6 changed files with 74 additions and 3 deletions
|
|
@ -773,9 +773,10 @@ bool MainWindow::saveLastDatabases()
|
|||
void MainWindow::updateTrayIcon()
|
||||
{
|
||||
if (isTrayIconEnabled()) {
|
||||
bool darkIcon = config()->get("GUI/DarkTrayIcon").toBool();
|
||||
|
||||
if (!m_trayIcon) {
|
||||
m_trayIcon = new QSystemTrayIcon(this);
|
||||
|
||||
QMenu* menu = new QMenu(this);
|
||||
|
||||
QAction* actionToggle = new QAction(tr("Toggle window"), menu);
|
||||
|
|
@ -795,11 +796,21 @@ void MainWindow::updateTrayIcon()
|
|||
connect(actionToggle, SIGNAL(triggered()), SLOT(toggleWindow()));
|
||||
|
||||
m_trayIcon->setContextMenu(menu);
|
||||
m_trayIcon->setIcon(filePath()->applicationIcon());
|
||||
|
||||
if(darkIcon){
|
||||
m_trayIcon->setIcon(filePath()->applicationIconDark());
|
||||
} else {
|
||||
m_trayIcon->setIcon(filePath()->applicationIcon());
|
||||
}
|
||||
|
||||
m_trayIcon->show();
|
||||
}
|
||||
if (m_ui->tabWidget->hasLockableDatabases()) {
|
||||
m_trayIcon->setIcon(filePath()->trayIconUnlocked());
|
||||
if(darkIcon){
|
||||
m_trayIcon->setIcon(filePath()->trayIconUnlockedDark());
|
||||
} else {
|
||||
m_trayIcon->setIcon(filePath()->trayIconUnlocked());
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_trayIcon->setIcon(filePath()->trayIconLocked());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue