From 3e87d7b703f0bed0694d5514999182dccc77a77a Mon Sep 17 00:00:00 2001 From: David Sansome Date: Thu, 14 Oct 2010 19:46:11 +0000 Subject: [PATCH] Add Ubuntu dark and light tray icons. Fixes issue #838 --- dist/CMakeLists.txt | 25 ++++++++++++++++++ .../clementine-panel-grey.png | Bin 0 -> 945 bytes .../ubuntu-mono-dark/clementine-panel.png | Bin 0 -> 1239 bytes .../clementine-panel-grey.png | Bin 0 -> 931 bytes .../ubuntu-mono-light/clementine-panel.png | Bin 0 -> 1138 bytes src/CMakeLists.txt | 14 ---------- src/ui/qtsystemtrayicon.cpp | 17 +++++++++--- src/ui/systemtrayicon.cpp | 3 +-- 8 files changed, 40 insertions(+), 19 deletions(-) create mode 100644 dist/icons/ubuntu-mono-dark/clementine-panel-grey.png create mode 100644 dist/icons/ubuntu-mono-dark/clementine-panel.png create mode 100644 dist/icons/ubuntu-mono-light/clementine-panel-grey.png create mode 100644 dist/icons/ubuntu-mono-light/clementine-panel.png diff --git a/dist/CMakeLists.txt b/dist/CMakeLists.txt index 091fefeb3..dc0d8e400 100644 --- a/dist/CMakeLists.txt +++ b/dist/CMakeLists.txt @@ -10,3 +10,28 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/maketarball.sh.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/windows/clementine.nsi.in ${CMAKE_CURRENT_SOURCE_DIR}/windows/clementine.nsi @ONLY) # windows/windres.rc is done by src/CMakeLists.txt + + +if (NOT APPLE) + install(FILES clementine_64.png + DESTINATION share/icons/hicolor/64x64/apps/ + RENAME application-x-clementine.png + ) + + install(FILES ../data/icon.svg + DESTINATION share/icons/hicolor/scalable/apps/ + RENAME application-x-clementine.svg + ) + + install(FILES clementine.desktop + DESTINATION share/applications + ) + + foreach(icon clementine-panel.png clementine-panel-grey.png) + foreach(theme ubuntu-mono-dark ubuntu-mono-light) + install(FILES icons/${theme}/${icon} + DESTINATION share/icons/${theme}/apps/24/ + ) + endforeach(theme) + endforeach(icon) +endif (NOT APPLE) diff --git a/dist/icons/ubuntu-mono-dark/clementine-panel-grey.png b/dist/icons/ubuntu-mono-dark/clementine-panel-grey.png new file mode 100644 index 0000000000000000000000000000000000000000..8425db6de01c86bb99f34891e5210013c25d468c GIT binary patch literal 945 zcmV;i15W&jP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L0HW0Z0HW0aUJ>Cd00007bV*G`2igh_ z6DkWc$MW(300S{eL_t(Y$GufcZyQw@J>SfDW-@-x#GcrWoN>~K@F=7Ru&^CFZ3Tr5 z>b`4MKvj0xvO#QE@()1lK&VTQpyW|#SEUk-K$OVicvD(Bj%s^6&fJepVkMBKaROXv z7FTnwj?Ovvd>8nS7wz3tE2Ynb5T_MI{%U3Q#s~iz!TEEwM7Psv*|}WIwzJr{`x|_} zcWdqX%@TN^Z0D`AG;QA^6RtnabJO zEW%KL0fb?Qr{Y^Jt_!*q9`ah4ulZj)@x;J#E{_zL2xLD0VI+s6r3W25D%)A z(kHcrl6pi1_{sNsPXr1fkhUlA>)m}#E;@xiv$$f7r->x#P>S75m>IGp z!L-Jav28>msuPCc+kM}^{C{q`_ct=jrE8&&6W#k!}bNO9_Zjpx5hS zn3srSbWLpP!^F!PZJ4r)I$Baui#iA2<`ws&DTB2-O#c}L!fWNJ;hefC0w%hHCDa(Yc$QZ@0y_tX+t!5K`uluFE7tnAwZ%yVW;@+PRE2^r( zFbojUk%)LFY>5bNV*`KOyY~yg=MOwnua#e7=Bt`MmM=ICk|`6+JpBIgBocv$(D!@z zb$uO!L2!pz%&)H9+&)x&y;i;)1i^=jqQq0CiD*0yV=M|)(*Q7-fqvgd_t7J?+aB7U zCp1l4T3-3#V~k>Nec{zJg2fxme1-*20f>=A2{2RuO%Q&TBWxqFf3Lp)y-GK2 Tsk%WS00000NkvXXu0mjf9OkGk literal 0 HcmV?d00001 diff --git a/dist/icons/ubuntu-mono-dark/clementine-panel.png b/dist/icons/ubuntu-mono-dark/clementine-panel.png new file mode 100644 index 0000000000000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NLh0L0HW0Z0HW0aUJ>Cd00007bV*G`2igh_ z6D$#!|EvxG00SdQL_t(Y$Gw%?j|*WK#^3MIX}iT%>0#Th!`kzy2rdW_uEYg#BXKP@ zA`&+e@h1>hf(yhy;6fy>EFlr>#1|3bk5B?h9V`Ru=v)LX`heD0Aoa^goZ%H^Dj=Sr9 z{pVH;kQ3vSbAD%JUY``D`XWc3?$-il!Z#m82r){D%VP0MntUzf!5(lRmt*)eSHVW1p_`K7`Ou z#d2ALv9Vx+5c0785dkz+t9tDs#-QX1o#9AiwIYcZ>IKy3{hKJIkW9+GsZ?qpI~#1N z2Otqjmpr8FI=p)y-&87<9?fM#^p5}tp@_*uN=tefAy5<*#>Ru$e7^WxO-~-zcn19z zfDj@QfvTH@j4@cPR_JKo9CJ7v!jh&B^YhiMhG8690Ic`*t5&P^ zP-jO=(rgyKbW=aZ>ve_&LAdghC)M=i(R3zrB^;g+RCUge5CVkIZ;yyE4jVT%O}4eR zKC|2H12x}NB+*?imv5^1{K056){xESfDi(;U|+|{7z2yN481)amBz+3x7-`Hoq^^4 zDmgK}2O)I1TrO{zl_WX)Ntx3P*sW>WLWGzFQ$a8j(d+Tpoi3M|bAHO{4-D2^`oEGQ zi5`qlHwS3N7&UXwR{;RRm}rc#0_Qvi0HWR9Jp%t*p8=)xVpDHET=f6|002ovPDHLk FV1j(uqul@i literal 0 HcmV?d00001 diff --git a/dist/icons/ubuntu-mono-light/clementine-panel.png b/dist/icons/ubuntu-mono-light/clementine-panel.png new file mode 100644 index 0000000000000000000000000000000000000000..302852c465181d9ccbbd0c5ec4bd2b16196fe9b4 GIT binary patch literal 1138 zcmV-&1daQNP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L0HW0Z0HW0aUJ>Cd00007bV*G`2igh_ z6Cx+c#uOO<00Z(#L_t(Y$E}rZY*S?v$Ip3sU)s{qmDOIhreIKsDNVL+B4Y_LnM8#s zWKko!7$u4X5=?v{#KaFoKbVXRgUQC?B#z-CGYqnXfI(+8gF!ZJJF_v_yRCa^!LIAN zwY|5y#}C_0aFo$5{6F6FJkRg`&pFR|001E5_rX#H{XPf=?){#%v_rmcti@z>Xulfw zSIT-!Q}@gV(>R{ybH&dk6h|`D`K@>N^P!L(`#~LMY%nfB3@# zR9sxBmTi5STrQ{Da<-nr6Fr}5PF5<8h@4m2+AFSh{0@3iL;!%*IVP+=Q4fN^e|BfA z+h?^GUJM0%U~?2@4PfDLap4!MG*9Rvj@nEvTbBE z0Emcp2M`he4M(8rcpVc2?pFW+X`MTJ01yu|4s~Ft2sha*miN2%QB55-e$= zds1c4>+#xk5551cZTAY+-$$6FH{#QAUYizl2$Y}PDBxRZ2 zs(cyuyzpv2f^jqcv^C}_aY);x;I){908HZ-tD4ZtQs5|b#!+541IqM8pb9=EIJ(pLBc9(hhT z&xzucno5lWQ7<#D??gn%`1QNrv?OH=NS#PKzn1R#4}uZldLlb7G5`Po07*qoM6N<$ Eg1Qq7M*si- literal 0 HcmV?d00001 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f23f15224..992f61cf2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -849,18 +849,4 @@ else (APPLE) install(TARGETS clementine RUNTIME DESTINATION bin ) - - install(FILES ../dist/clementine_64.png - DESTINATION share/icons/hicolor/64x64/apps/ - RENAME application-x-clementine.png - ) - - install(FILES ../data/icon.svg - DESTINATION share/icons/hicolor/scalable/apps/ - RENAME application-x-clementine.svg - ) - - install(FILES ../dist/clementine.desktop - DESTINATION share/applications - ) endif (APPLE) diff --git a/src/ui/qtsystemtrayicon.cpp b/src/ui/qtsystemtrayicon.cpp index aaf27e6d6..1afa5924c 100644 --- a/src/ui/qtsystemtrayicon.cpp +++ b/src/ui/qtsystemtrayicon.cpp @@ -14,6 +14,7 @@ along with Clementine. If not, see . */ +#include "iconloader.h" #include "qtsystemtrayicon.h" #include @@ -26,9 +27,19 @@ QtSystemTrayIcon::QtSystemTrayIcon(QObject* parent) tray_(new QSystemTrayIcon(this)), menu_(new QMenu) { - QIcon icon(":icon.png"); - orange_icon_ = icon.pixmap(48, QIcon::Normal); - grey_icon_ = icon.pixmap(48, QIcon::Disabled); + QIcon theme_icon = IconLoader::Load("clementine-panel"); + QIcon theme_icon_grey = IconLoader::Load("clementine-panel-grey"); + + if (theme_icon.isNull() || theme_icon_grey.isNull()) { + // Load the default icon + QIcon icon(":icon.png"); + orange_icon_ = icon.pixmap(48, QIcon::Normal); + grey_icon_ = icon.pixmap(48, QIcon::Disabled); + } else { + // Use the icons from the theme + orange_icon_ = theme_icon.pixmap(48); + grey_icon_ = theme_icon_grey.pixmap(48); + } tray_->setIcon(orange_icon_); tray_->setToolTip(QCoreApplication::applicationName()); diff --git a/src/ui/systemtrayicon.cpp b/src/ui/systemtrayicon.cpp index 45599b4a2..aba1d0c5e 100644 --- a/src/ui/systemtrayicon.cpp +++ b/src/ui/systemtrayicon.cpp @@ -14,10 +14,9 @@ along with Clementine. If not, see . */ -#include "systemtrayicon.h" - #include "macsystemtrayicon.h" #include "qtsystemtrayicon.h" +#include "systemtrayicon.h" #include #include