From 09cb95d3da82c767cc5cbe60a67a427b2bef78fc Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Tue, 26 Sep 2017 02:17:32 +0300 Subject: [PATCH] Use the SVG for the tray icon. --- AUTHORS | 2 +- dist/unix/CMakeLists.txt | 1 + src/gui/mainwindow.cpp | 9 ++++----- src/icons.qrc | 2 +- .../qbittorrent-tray-with-font.svg} | 0 .../qbittorrent-tray.svg} | 0 src/icons/skin/qbittorrent22.png | Bin 1169 -> 0 bytes unixconf.pri | 3 ++- 8 files changed, 9 insertions(+), 8 deletions(-) rename src/icons/{qbittorrent-with-font.svg => skin/qbittorrent-tray-with-font.svg} (100%) rename src/icons/{qbittorrent.svg => skin/qbittorrent-tray.svg} (100%) delete mode 100644 src/icons/skin/qbittorrent22.png diff --git a/AUTHORS b/AUTHORS index 9b5ec27fc..b8faafa04 100644 --- a/AUTHORS +++ b/AUTHORS @@ -34,7 +34,7 @@ Code from other projects: license: GPLv2/3 Images Authors: -* files: src/icons/qbittorrent.svg (and related pngs) +* files: src/icons/skin/qbittorrent-tray.svg (and related pngs) copyright: Provided by HVS (raster first proposal) and Atif Afzal(@atfzl github) (vectorized and modified) license: GPLv2+ diff --git a/dist/unix/CMakeLists.txt b/dist/unix/CMakeLists.txt index 2dfb3f4fa..5864da910 100644 --- a/dist/unix/CMakeLists.txt +++ b/dist/unix/CMakeLists.txt @@ -38,6 +38,7 @@ if (GUI) COMPONENT data) install(FILES + ${qBittorrent_SOURCE_DIR}/src/icons/skin/qbittorrent-tray.svg ${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 diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index f923729ac..793df0026 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -1960,6 +1960,8 @@ QIcon MainWindow::getSystrayIcon() const } #else switch (style) { + case TrayIcon::NORMAL: + return QIcon(QLatin1String(":/icons/skin/qbittorrent-tray.svg")); case TrayIcon::MONO_DARK: return QIcon(QLatin1String(":/icons/skin/qbittorrent-tray-dark.svg")); case TrayIcon::MONO_LIGHT: @@ -1969,11 +1971,8 @@ QIcon MainWindow::getSystrayIcon() const } #endif - QIcon icon; - 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; + // As a failsafe in case the enum is invalid + return QIcon(QLatin1String(":/icons/skin/qbittorrent-tray.svg")); } #endif diff --git a/src/icons.qrc b/src/icons.qrc index 4d75fcd5c..63bb6d176 100644 --- a/src/icons.qrc +++ b/src/icons.qrc @@ -359,10 +359,10 @@ icons/skin/logo2.gif icons/skin/mascot.png icons/skin/paused.png + icons/skin/qbittorrent-tray.svg icons/skin/qbittorrent-tray-dark.svg icons/skin/qbittorrent-tray-light.svg icons/skin/qbittorrent16.png - icons/skin/qbittorrent22.png icons/skin/qbittorrent32.png icons/skin/queued.png icons/skin/ratio.png diff --git a/src/icons/qbittorrent-with-font.svg b/src/icons/skin/qbittorrent-tray-with-font.svg similarity index 100% rename from src/icons/qbittorrent-with-font.svg rename to src/icons/skin/qbittorrent-tray-with-font.svg diff --git a/src/icons/qbittorrent.svg b/src/icons/skin/qbittorrent-tray.svg similarity index 100% rename from src/icons/qbittorrent.svg rename to src/icons/skin/qbittorrent-tray.svg diff --git a/src/icons/skin/qbittorrent22.png b/src/icons/skin/qbittorrent22.png deleted file mode 100644 index 94c6645458a08ddc25b5d44a8b6d0daec4d4f01d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1169 zcmV;C1aA9@P)szdyF9c6aaND#*dnO}V)7V^IW{iU|rUMx_ z&Z2R~z;qwS?oH*|_I37)n}W6zI|(V6;N{TAL>s*NFxL=HQgFTuYJgVzxB>UOWHi-# zZ?@Ff4-rCC0FYqlv843~Xy~a1N-3yTG|GxrIvJ%<2*cTy3J?fCGynG_l0*N^(4M~W zOg8|S;LDG+Gn0#I(_&oJLCg#iX2SIfxB9JMrf(_1TsVi(sbtH=d#P3(EV`dA(6-yt zS((z6ATxpKqY%=QFZoRPwZ9{BI>kP^6X#wjPUw+`3xyyvU>3q~FzCX`0~KiA?L~!C z#*sR&el=!*H~JK`zfq0PPHn{dhyAcwxCtMfN^DnC^r#d~(&k7~l}m3*(fG0liVXaE zBaG|gaU865Be>21@X`|ro!aNa_k)Y*xG)2oLeT!^dKiUaA)1w^Lg{0YL{J+^7Idf6 zCSh%*6_;;Ekx1n+AI;+0SPX=~tVpP<2z@Z0!CW+luLkC@Yoi0zZbk3OLM#i5gq;#N z_a-x%9^|wWq%stloN9u?@hkusP2>=o31!819hA(d2qg*#tdaGYSUd-bz$=x4jAp4! zug(ZE8z>}B;VX%Yq^3`{5abF=jTDj?<1xEJbWkXfM{z{quo6%MVnwDQH`u z%)C*hONP&>;L&_qPvo*&piv%`G?k5e9Fh)7B=Z=3kihZR)*`sxfmgP;v3G|L0L&rD zYYe9k1>I@2}i1iG6A>Q#$t5c(i2`wqojp zjK(~3>KH3QkM3Ki6>s^ekC21}0LNl^sG0v?McM?~7uFN*fEM`{iVB=ioGh{+fHNN!c$-NZ^2qBsQHYKtv zy|>Y_s3hVhRHuU3A j