diff --git a/dist/unix/CMakeLists.txt b/dist/unix/CMakeLists.txt
index 8d4be6399..2dfb3f4fa 100644
--- a/dist/unix/CMakeLists.txt
+++ b/dist/unix/CMakeLists.txt
@@ -36,4 +36,10 @@ if (GUI)
install(FILES qbittorrent.appdata.xml
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/appdata/
COMPONENT data)
+
+ install(FILES
+ ${qBittorrent_SOURCE_DIR}/src/icons/skin/qbittorrent-tray-dark.svg
+ ${qBittorrent_SOURCE_DIR}/src/icons/skin/qbittorrent-tray-light.svg
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status
+ COMPONENT data)
endif()
diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp
index d76768c2c..0ea66a4e8 100644
--- a/src/gui/mainwindow.cpp
+++ b/src/gui/mainwindow.cpp
@@ -1813,27 +1813,37 @@ void MainWindow::checkForActiveTorrents()
QIcon MainWindow::getSystrayIcon() const
{
- TrayIcon::Style style = Preferences::instance()->trayIconStyle();
+#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
+ if (Preferences::instance()->useSystemIconTheme())
+ return QIcon::fromTheme("qbittorrent-tray");
+#endif
+
+ const TrayIcon::Style style = Preferences::instance()->trayIconStyle();
+ // on Linux we use theme icons, and icons from resources everywhere else
+#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
+ switch (style) {
+ case TrayIcon::MONO_DARK:
+ return QIcon::fromTheme(QLatin1String("qbittorrent-tray-dark"));
+ case TrayIcon::MONO_LIGHT:
+ return QIcon::fromTheme(QLatin1String("qbittorrent-tray-light"));
+ default:
+ break;
+ }
+#else
switch (style) {
case TrayIcon::MONO_DARK:
- return QIcon(":/icons/skin/qbittorrent_mono_dark.png");
+ return QIcon(QLatin1String(":/icons/skin/qbittorrent-tray-dark.svg"));
case TrayIcon::MONO_LIGHT:
- return QIcon(":/icons/skin/qbittorrent_mono_light.png");
+ return QIcon(QLatin1String(":/icons/skin/qbittorrent-tray-light.svg"));
default:
break;
}
+#endif
QIcon icon;
-#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
- if (Preferences::instance()->useSystemIconTheme())
- icon = QIcon::fromTheme("qbittorrent-tray");
-
-#endif
- if (icon.isNull()) {
- icon.addFile(":/icons/skin/qbittorrent22.png", QSize(22, 22));
- icon.addFile(":/icons/skin/qbittorrent16.png", QSize(16, 16));
- icon.addFile(":/icons/skin/qbittorrent32.png", QSize(32, 32));
- }
+ icon.addFile(":/icons/skin/qbittorrent22.png", QSize(22, 22));
+ icon.addFile(":/icons/skin/qbittorrent16.png", QSize(16, 16));
+ icon.addFile(":/icons/skin/qbittorrent32.png", QSize(32, 32));
return icon;
}
diff --git a/src/icons.qrc b/src/icons.qrc
index 47d182380..b3247798f 100644
--- a/src/icons.qrc
+++ b/src/icons.qrc
@@ -353,8 +353,8 @@
icons/skin/qbittorrent16.png
icons/skin/qbittorrent22.png
icons/skin/qbittorrent32.png
- icons/skin/qbittorrent_mono_dark.png
- icons/skin/qbittorrent_mono_light.png
+ icons/skin/qbittorrent-tray-dark.svg
+ icons/skin/qbittorrent-tray-light.svg
icons/skin/queued.png
icons/skin/ratio.png
icons/skin/seeding.png
diff --git a/src/icons/skin/qbittorrent_mono.svg b/src/icons/skin/qbittorrent-tray-dark.svg
similarity index 100%
rename from src/icons/skin/qbittorrent_mono.svg
rename to src/icons/skin/qbittorrent-tray-dark.svg
diff --git a/src/icons/skin/qbittorrent-tray-light.svg b/src/icons/skin/qbittorrent-tray-light.svg
new file mode 100644
index 000000000..5fab7a0bd
--- /dev/null
+++ b/src/icons/skin/qbittorrent-tray-light.svg
@@ -0,0 +1,83 @@
+
+
+
+
diff --git a/src/icons/skin/qbittorrent_mono_dark.png b/src/icons/skin/qbittorrent_mono_dark.png
deleted file mode 100644
index fe2cdeafd..000000000
Binary files a/src/icons/skin/qbittorrent_mono_dark.png and /dev/null differ
diff --git a/src/icons/skin/qbittorrent_mono_light.png b/src/icons/skin/qbittorrent_mono_light.png
deleted file mode 100644
index 695cc3faf..000000000
Binary files a/src/icons/skin/qbittorrent_mono_light.png and /dev/null differ
diff --git a/unixconf.pri b/unixconf.pri
index a93a7a9d3..2280f282a 100644
--- a/unixconf.pri
+++ b/unixconf.pri
@@ -90,6 +90,11 @@ nogui:systemd {
statusIcon128.path = $$DATADIR/icons/hicolor/128x128/status/
statusIcon192.files = $$DIST_PATH/menuicons/192x192/status/qbittorrent-tray.png
statusIcon192.path = $$DATADIR/icons/hicolor/192x192/status/
+
+ statusIconScalable.files = $$PWD/src/icons/skin/qbittorrent-tray-dark.svg \
+ $$PWD/src/icons/skin/qbittorrent-tray-light.svg
+ statusIconScalable.path = $$DATADIR/icons/hicolor/scalable/status/
+
INSTALLS += \
icon16 \
icon22 \
@@ -112,7 +117,8 @@ nogui:systemd {
statusIcon72 \
statusIcon96 \
statusIcon128 \
- statusIcon192
+ statusIcon192 \
+ statusIconScalable
pixmap.files = $$DIST_PATH/menuicons/128x128/apps/qbittorrent.png
pixmap.path = $$DATADIR/pixmaps/