refactor: Only use symbolic tray icon
This commit is contained in:
committed by
Chris Rizzitello
parent
066e63cc86
commit
eee4efd59d
@ -753,17 +753,8 @@ void MainWindow::saveSettings() const
|
||||
|
||||
void MainWindow::setTrayIcon()
|
||||
{
|
||||
QString iconString = kRevFqdnName;
|
||||
|
||||
if (deskflow::platform::isSandboxed()) {
|
||||
iconString = QStringLiteral(":/icons/%1-%2/apps/64/%3").arg(kAppId, iconMode(), kRevFqdnName);
|
||||
}
|
||||
|
||||
if (!Settings::value(Settings::Gui::SymbolicTrayIcon).toBool()) {
|
||||
m_trayIcon->setIcon(QIcon::fromTheme(iconString));
|
||||
return;
|
||||
}
|
||||
|
||||
static const auto themeIcon = QStringLiteral("%1-symbolic").arg(kRevFqdnName);
|
||||
static const auto fallbackPath = QStringLiteral(":/icons/%1-%2/apps/64/%3");
|
||||
#ifdef Q_OS_WIN
|
||||
QSettings settings(
|
||||
QStringLiteral("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"),
|
||||
@ -771,13 +762,12 @@ void MainWindow::setTrayIcon()
|
||||
);
|
||||
const QString theme = settings.value(QStringLiteral("SystemUsesLightTheme"), 1).toBool() ? QStringLiteral("light")
|
||||
: QStringLiteral("dark");
|
||||
iconString = QStringLiteral(":/icons/deskflow-%1/apps/64/%2").arg(theme, kRevFqdnName);
|
||||
#endif
|
||||
|
||||
iconString.append(QStringLiteral("-symbolic"));
|
||||
auto icon = QIcon::fromTheme(iconString);
|
||||
m_trayIcon->setIcon(QIcon(fallbackPath.arg(kAppId, theme, themeIcon)));
|
||||
#else
|
||||
auto icon = QIcon::fromTheme(themeIcon, QIcon(fallbackPath.arg(kAppId, iconMode(), themeIcon)));
|
||||
icon.setIsMask(true);
|
||||
m_trayIcon->setIcon(icon);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::handleLogLine(const QString &line)
|
||||
|
||||
Reference in New Issue
Block a user