Skip to content

Commit

Permalink
Fix dark tray icon option making all icons dark
Browse files Browse the repository at this point in the history
Introduces a separate path for tray icons which are neither locked nor
unlocked.

Closes keepassxreboot#1556.
  • Loading branch information
luzat authored and TheZ3ro committed Mar 8, 2018
1 parent 2fcaeea commit 082ecc3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/core/FilePath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ QString FilePath::wordlistPath(const QString& name)
}

QIcon FilePath::applicationIcon()
{
#ifdef KEEPASSXC_DIST_SNAP
return icon("apps", "keepassxc", false);
#else
return icon("apps", "keepassxc");
#endif
}

QIcon FilePath::trayIcon()
{
bool darkIcon = useDarkIcon();

Expand All @@ -107,7 +116,6 @@ QIcon FilePath::applicationIcon()
#endif
}


QIcon FilePath::trayIconLocked()
{
#ifdef KEEPASSXC_DIST_SNAP
Expand Down
1 change: 1 addition & 0 deletions src/core/FilePath.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class FilePath
QString pluginPath(const QString& name);
QString wordlistPath(const QString& name);
QIcon applicationIcon();
QIcon trayIcon();
QIcon trayIconLocked();
QIcon trayIconUnlocked();
QIcon icon(const QString& category, const QString& name, bool fromTheme = true);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ void MainWindow::updateTrayIcon()

m_trayIcon->setContextMenu(menu);

m_trayIcon->setIcon(filePath()->applicationIcon());
m_trayIcon->setIcon(filePath()->trayIcon());
m_trayIcon->show();
}
if (m_ui->tabWidget->hasLockableDatabases()) {
Expand Down

0 comments on commit 082ecc3

Please sign in to comment.