Added dark tray icon parameter to settings.

This commit is contained in:
Vlad N 2017-10-21 15:16:52 +03:00 committed by Janek Bevendorff
parent f80b5af432
commit 55271311c4
6 changed files with 74 additions and 3 deletions

View file

@ -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());