mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-28 02:38:17 +03:00
parent
7bc49423c7
commit
a1ff1c8227
1 changed files with 13 additions and 5 deletions
|
@ -286,17 +286,25 @@ void DesktopIntegration::createTrayIcon()
|
||||||
QIcon DesktopIntegration::getSystrayIcon() const
|
QIcon DesktopIntegration::getSystrayIcon() const
|
||||||
{
|
{
|
||||||
const TrayIcon::Style style = Preferences::instance()->trayIconStyle();
|
const TrayIcon::Style style = Preferences::instance()->trayIconStyle();
|
||||||
|
QIcon icon;
|
||||||
switch (style)
|
switch (style)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case TrayIcon::Style::Normal:
|
case TrayIcon::Style::Normal:
|
||||||
return UIThemeManager::instance()->getIcon(u"qbittorrent-tray"_s);
|
icon = UIThemeManager::instance()->getIcon(u"qbittorrent-tray"_s);
|
||||||
|
break;
|
||||||
case TrayIcon::Style::MonoDark:
|
case TrayIcon::Style::MonoDark:
|
||||||
return UIThemeManager::instance()->getIcon(u"qbittorrent-tray-dark"_s);
|
icon = UIThemeManager::instance()->getIcon(u"qbittorrent-tray-dark"_s);
|
||||||
|
break;
|
||||||
case TrayIcon::Style::MonoLight:
|
case TrayIcon::Style::MonoLight:
|
||||||
return UIThemeManager::instance()->getIcon(u"qbittorrent-tray-light"_s);
|
icon = UIThemeManager::instance()->getIcon(u"qbittorrent-tray-light"_s);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
#if ((QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && defined(Q_OS_UNIX) && !defined(Q_OS_MACOS))
|
||||||
|
// Workaround for invisible tray icon in KDE, https://bugreports.qt.io/browse/QTBUG-53550
|
||||||
|
return {icon.pixmap(32)};
|
||||||
|
#else
|
||||||
|
return icon;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif // Q_OS_MACOS
|
#endif // Q_OS_MACOS
|
||||||
|
|
Loading…
Reference in a new issue