From d0b5667449f392d1f244bd5f03aeb21a563ab805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= <sebastien.blin@savoirfairelinux.com> Date: Mon, 5 Jul 2021 15:07:13 -0400 Subject: [PATCH] systray: change systray icon when we have notifications Also use jami.svg for regular systray icon. Change-Id: I6325c756d10216a017eb89042ab2f6ca0e988703 --- images/jami-new.svg | 364 +++++++++++++++++++++++++++++++++++ resources.qrc | 2 + src/conversationsadapter.cpp | 3 + src/lrcinstance.cpp | 6 + src/lrcinstance.h | 1 + src/mainapplication.cpp | 2 +- src/systemtray.cpp | 14 +- src/systemtray.h | 1 + 8 files changed, 390 insertions(+), 3 deletions(-) create mode 100644 images/jami-new.svg diff --git a/images/jami-new.svg b/images/jami-new.svg new file mode 100644 index 000000000..b3f33e960 --- /dev/null +++ b/images/jami-new.svg @@ -0,0 +1,364 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 116.3 116.3" style="enable-background:new 0 0 116.3 116.3;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:url(#SVGID_1_);} + .st1{fill:url(#SVGID_2_);} + .st2{fill:url(#SVGID_3_);} + .st3{fill:url(#SVGID_4_);} + .st4{fill:url(#SVGID_5_);} + .st5{fill:url(#SVGID_6_);} + .st6{opacity:0.4;fill:url(#SVGID_7_);enable-background:new ;} + .st7{fill:url(#SVGID_8_);} + .st8{fill:url(#SVGID_9_);} + .st9{fill:url(#SVGID_10_);} + .st10{fill:url(#SVGID_11_);} + .st11{fill:url(#SVGID_12_);} + .st12{fill:url(#SVGID_13_);} + .st13{fill:url(#SVGID_14_);} + .st14{fill:url(#SVGID_15_);} + .st15{fill:url(#SVGID_16_);} + .st16{opacity:0.2;fill:url(#SVGID_17_);enable-background:new ;} + .st17{fill:url(#SVGID_18_);} + .st18{fill:url(#SVGID_19_);} + .st19{opacity:0.25;fill:url(#SVGID_20_);enable-background:new ;} + .st20{fill:url(#SVGID_21_);} + .st21{fill:url(#SVGID_22_);} + .st22{opacity:0.2;fill:url(#SVGID_23_);enable-background:new ;} + .st23{fill:url(#SVGID_24_);} +</style> +<g> + <g> + + <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="69.0328" y1="454.9245" x2="64.4435" y2="449.5703" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2B3B6A"/> + <stop offset="1" style="stop-color:#2B3B6A"/> + </linearGradient> + <polygon class="st0" points="54.9,55.8 62,55.6 58.4,62.2 "/> + + <linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="108.534" y1="457.2333" x2="108.534" y2="494.0327" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2B3B6A"/> + <stop offset="7.040000e-02" style="stop-color:#2D4576"/> + <stop offset="0.2165" style="stop-color:#2E5589"/> + <stop offset="0.3608" style="stop-color:#2B5E97"/> + <stop offset="0.5" style="stop-color:#29629C"/> + <stop offset="0.6392" style="stop-color:#2B5E97"/> + <stop offset="0.7835" style="stop-color:#2E5589"/> + <stop offset="0.9296" style="stop-color:#2D4576"/> + <stop offset="1" style="stop-color:#2B3B6A"/> + </linearGradient> + <path class="st1" d="M85.5,57.5c26.1,4.2,29.8,10.7,29.8,10.7c0,0.4,0,0.8,0,1.2c0,0.2-0.1,0.4-0.2,0.7c-0.1,0.3-2.7,5.7-19.6,9.3 + L85.5,57.5z"/> + + <linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="26.7686" y1="496.8278" x2="38.7091" y2="475.5678" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#252B59"/> + <stop offset="8.590000e-02" style="stop-color:#2B3A69"/> + <stop offset="0.2267" style="stop-color:#2E4A7C"/> + <stop offset="0.3658" style="stop-color:#2E5487"/> + <stop offset="0.5" style="stop-color:#2D578C"/> + <stop offset="0.6342" style="stop-color:#2E5487"/> + <stop offset="0.7733" style="stop-color:#2E4A7C"/> + <stop offset="0.9141" style="stop-color:#2B3A69"/> + <stop offset="1" style="stop-color:#252B59"/> + </linearGradient> + <path class="st2" d="M19.8,78.5c-5.9,15.7-2.9,20.6-2.7,21c0.1,0.2,0.2,0.4,0.4,0.5c0.4,0,0.8-0.1,1.2-0.2c0,0,10.7-0.5,23.2-18.3 + L19.8,78.5z"/> + + <linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="60.8512" y1="424.6486" x2="41.0872" y2="401.5905" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#181844"/> + <stop offset="2.840000e-02" style="stop-color:#1E1E4C"/> + <stop offset="0.1353" style="stop-color:#283261"/> + <stop offset="0.2468" style="stop-color:#2D4172"/> + <stop offset="0.3647" style="stop-color:#2E4A7C"/> + <stop offset="0.5" style="stop-color:#2E4D7F"/> + <stop offset="0.6177" style="stop-color:#2D4576"/> + <stop offset="0.8125" style="stop-color:#273160"/> + <stop offset="1" style="stop-color:#181844"/> + </linearGradient> + <path class="st3" d="M58.8,18.6C44.5,2.9,37.5,3.8,37.1,3.9c-0.2,0-0.5,0.1-0.7,0.2c-0.5,0.2-1,1.8-1,1.8s-3,8.7,9.1,31.9 + L58.8,18.6z"/> + + <linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="99.9721" y1="499.3526" x2="84.7036" y2="450.1664" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#181844"/> + <stop offset="2.840000e-02" style="stop-color:#1E1E4C"/> + <stop offset="0.1353" style="stop-color:#283261"/> + <stop offset="0.2468" style="stop-color:#2D4172"/> + <stop offset="0.3647" style="stop-color:#2E4A7C"/> + <stop offset="0.5" style="stop-color:#2E4D7F"/> + <stop offset="0.6177" style="stop-color:#2D4576"/> + <stop offset="0.8125" style="stop-color:#273160"/> + <stop offset="1" style="stop-color:#181844"/> + </linearGradient> + <path class="st4" d="M71.2,78.8C90.6,101,97.4,99.8,97.4,99.8c0.4,0.1,0.9,0.2,1.3,0.2c0.2-0.1,0.3-0.3,0.4-0.5 + c0.3-0.4,5.8-9.4-12.8-41.8L71.2,78.8z"/> + + <linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="31.6447" y1="457.2331" x2="31.6447" y2="494.0317" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2B3B6A"/> + <stop offset="7.040000e-02" style="stop-color:#2D4576"/> + <stop offset="0.2165" style="stop-color:#2E5589"/> + <stop offset="0.3608" style="stop-color:#2B5E97"/> + <stop offset="0.5" style="stop-color:#29629C"/> + <stop offset="0.6392" style="stop-color:#2B5E97"/> + <stop offset="0.7835" style="stop-color:#2E5589"/> + <stop offset="0.9296" style="stop-color:#2D4576"/> + <stop offset="1" style="stop-color:#2B3B6A"/> + </linearGradient> + <path class="st5" d="M46.1,82.2c-40-1.7-44.8-11.6-45-12.1C1.1,69.9,1,69.7,1,69.5c0.1-0.7,1.5-2,1.5-2s10.6-6.5,28.3-10 + L46.1,82.2z"/> + + <linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="51.8906" y1="421.1236" x2="66.337" y2="421.1236" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2B3B6A"/> + <stop offset="1" style="stop-color:#2B3B6A"/> + </linearGradient> + <path class="st6" d="M57.6,17.4c-5,5.4-9.6,11.2-13.8,17.2h1c3.1-3.9,10.8-13.7,13.4-16.5L57.6,17.4z"/> + + <linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="70.9709" y1="436.4003" x2="70.9709" y2="401.6908" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#252B59"/> + <stop offset="0.5" style="stop-color:#2D578C"/> + <stop offset="0.6934" style="stop-color:#2D5588"/> + <stop offset="0.8038" style="stop-color:#2E4F80"/> + <stop offset="0.8932" style="stop-color:#2D4474"/> + <stop offset="0.971" style="stop-color:#283463"/> + <stop offset="1" style="stop-color:#252B59"/> + </linearGradient> + <path class="st7" d="M73.8,35.4C84.2,10.7,80.2,5,80.2,5c-0.1-0.3-0.2-0.7-0.3-1c-0.2-0.1-0.4-0.1-0.7-0.2 + c-0.5-0.1-11.4-1.5-34.4,30.7L73.8,35.4z"/> + + <linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="39.2669" y1="503.7654" x2="102.6764" y2="407.9172" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2867A2"/> + <stop offset="8.239999e-02" style="stop-color:#177EBC"/> + <stop offset="0.1675" style="stop-color:#0E91D1"/> + <stop offset="0.2527" style="stop-color:#10A2E1"/> + <stop offset="0.337" style="stop-color:#18ACEA"/> + <stop offset="0.42" style="stop-color:#24B1ED"/> + <stop offset="0.5" style="stop-color:#28B1ED"/> + <stop offset="0.58" style="stop-color:#24B1ED"/> + <stop offset="0.663" style="stop-color:#18ACEA"/> + <stop offset="0.7473" style="stop-color:#10A2E1"/> + <stop offset="0.8325" style="stop-color:#0E91D1"/> + <stop offset="0.9176" style="stop-color:#177EBC"/> + <stop offset="1" style="stop-color:#2867A2"/> + </linearGradient> + <path class="st8" d="M58,97.4c-14.2,15.4-21,14.5-21.4,14.5c-0.6-0.2-1.2-0.5-1.7-0.8l-17.3-11c7.3-1.6,16.3-10.2,25.7-21.3 + L58,97.4z"/> + + <linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="33.568" y1="505.6873" x2="58.683" y2="483.2007" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2C5D95"/> + <stop offset="8.220001e-02" style="stop-color:#246EAB"/> + <stop offset="0.1808" style="stop-color:#1B79B9"/> + <stop offset="0.3007" style="stop-color:#1080C2"/> + <stop offset="0.5" style="stop-color:#0E81C5"/> + <stop offset="0.6993" style="stop-color:#1080C2"/> + <stop offset="0.8192" style="stop-color:#1B79B9"/> + <stop offset="0.9178" style="stop-color:#246EAB"/> + <stop offset="1" style="stop-color:#2C5D95"/> + </linearGradient> + <path class="st9" d="M58.6,98c-14.2,15.4-21,14.5-21.4,14.5c-0.6-0.2-1.2-0.5-1.7-0.8L17.6,100c7.3-1.6,16.9-9.6,26.3-20.7 + L58.6,98z"/> + + <linearGradient id="SVGID_11_" gradientUnits="userSpaceOnUse" x1="31.3212" y1="407.2591" x2="89.6399" y2="504.4568" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2C5D95"/> + <stop offset="1.760000e-02" style="stop-color:#2A6199"/> + <stop offset="0.1407" style="stop-color:#1C79B7"/> + <stop offset="0.2631" style="stop-color:#0A8CCA"/> + <stop offset="0.3837" style="stop-color:#0B97D4"/> + <stop offset="0.5" style="stop-color:#0E9AD8"/> + <stop offset="0.6163" style="stop-color:#0B97D4"/> + <stop offset="0.7369" style="stop-color:#0A8CCA"/> + <stop offset="0.8593" style="stop-color:#1C79B7"/> + <stop offset="0.9824" style="stop-color:#2A6199"/> + <stop offset="1" style="stop-color:#2C5D95"/> + </linearGradient> + <path class="st10" d="M20.7,38c-6.3-16.2-3.2-21.3-3-21.6c0.4-0.5,0.9-0.9,1.4-1.2l17.3-11c-1.5,7.1,2.3,18,8.2,30.7L20.7,38z"/> + + <linearGradient id="SVGID_12_" gradientUnits="userSpaceOnUse" x1="94.4028" y1="503.8655" x2="56.9038" y2="456.6339" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2C5D95"/> + <stop offset="2.570000e-02" style="stop-color:#2A6199"/> + <stop offset="0.2053" style="stop-color:#1C79B7"/> + <stop offset="0.384" style="stop-color:#0A8CCA"/> + <stop offset="0.5599" style="stop-color:#0B97D4"/> + <stop offset="0.7296" style="stop-color:#0E9AD8"/> + <stop offset="0.7925" style="stop-color:#0B97D4"/> + <stop offset="0.8577" style="stop-color:#0A8CCA"/> + <stop offset="0.9239" style="stop-color:#1C79B7"/> + <stop offset="0.9905" style="stop-color:#2A6199"/> + <stop offset="1" style="stop-color:#2C5D95"/> + </linearGradient> + <path class="st11" d="M57.2,57.2c-8.7,0-17.4,0.7-26,1.9c0.3,0.5,4.3,7.2,7.2,11.7c27.8,42.8,40.8,41.1,41.4,41 + c0.6-0.2,1.2-0.5,1.7-0.8l17.3-11C87,97.5,70.6,78.2,57.2,57.2z"/> + + <linearGradient id="SVGID_13_" gradientUnits="userSpaceOnUse" x1="40.2175" y1="431.0724" x2="32.9164" y2="404.7886" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2C5D95"/> + <stop offset="8.220001e-02" style="stop-color:#246EAB"/> + <stop offset="0.1808" style="stop-color:#1B79B9"/> + <stop offset="0.3007" style="stop-color:#1080C2"/> + <stop offset="0.5" style="stop-color:#0E81C5"/> + <stop offset="0.6993" style="stop-color:#1080C2"/> + <stop offset="0.8192" style="stop-color:#1B79B9"/> + <stop offset="0.9178" style="stop-color:#246EAB"/> + <stop offset="1" style="stop-color:#2C5D95"/> + </linearGradient> + <path class="st12" d="M20.1,38.5c-6.3-16.2-3.2-21.3-3-21.6c0.4-0.5,0.9-0.9,1.4-1.2L36.5,4.1c-1.5,7.1,1.7,18.6,7.6,31.2 + L20.1,38.5z"/> + + <linearGradient id="SVGID_14_" gradientUnits="userSpaceOnUse" x1="122.9025" y1="448.7971" x2="9.1479" y2="448.7971" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2867A2"/> + <stop offset="1.280000e-02" style="stop-color:#256BA7"/> + <stop offset="0.1121" style="stop-color:#0B83C3"/> + <stop offset="0.2115" style="stop-color:#1797D8"/> + <stop offset="0.3099" style="stop-color:#25A3E2"/> + <stop offset="0.4066" style="stop-color:#27ABE7"/> + <stop offset="0.5" style="stop-color:#2AAEEA"/> + <stop offset="0.5934" style="stop-color:#27ABE7"/> + <stop offset="0.6901" style="stop-color:#25A3E2"/> + <stop offset="0.7885" style="stop-color:#1797D8"/> + <stop offset="0.8879" style="stop-color:#0B83C3"/> + <stop offset="0.9872" style="stop-color:#256BA7"/> + <stop offset="1" style="stop-color:#2867A2"/> + </linearGradient> + <path class="st13" d="M85.5,59.6c13.5,1.9,24.7,4.7,29.8,9.8V48.9c0-0.6-0.1-1.3-0.2-1.9c-0.1-0.3-2.7-5.6-19-9.1L85.5,59.6z"/> + + <linearGradient id="SVGID_15_" gradientUnits="userSpaceOnUse" x1="90.2941" y1="447.1362" x2="122.8074" y2="448.8884" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2E5284"/> + <stop offset="6.100000e-03" style="stop-color:#2E5486"/> + <stop offset="9.120000e-02" style="stop-color:#29649D"/> + <stop offset="0.1876" style="stop-color:#236FAD"/> + <stop offset="0.3049" style="stop-color:#1D77B6"/> + <stop offset="0.5" style="stop-color:#1C78B9"/> + <stop offset="0.6951" style="stop-color:#1D77B6"/> + <stop offset="0.8124" style="stop-color:#236FAD"/> + <stop offset="0.9088" style="stop-color:#29649D"/> + <stop offset="0.9939" style="stop-color:#2E5486"/> + <stop offset="1" style="stop-color:#2E5284"/> + </linearGradient> + <path class="st14" d="M85.5,58.8c13.5,1.9,24.7,5.5,29.8,10.6V48.1c0-0.6-0.1-1.3-0.2-1.9c-0.1-0.3-2.7-5.6-19-9.1L85.5,58.8z"/> + + <linearGradient id="SVGID_16_" gradientUnits="userSpaceOnUse" x1="9.0577" y1="447.1912" x2="67.7186" y2="447.1912" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2867A2"/> + <stop offset="2.250000e-02" style="stop-color:#256BA7"/> + <stop offset="0.1971" style="stop-color:#0B83C3"/> + <stop offset="0.3718" style="stop-color:#1797D8"/> + <stop offset="0.5447" style="stop-color:#25A3E2"/> + <stop offset="0.7147" style="stop-color:#27ABE7"/> + <stop offset="0.8788" style="stop-color:#2AAEEA"/> + <stop offset="0.9015" style="stop-color:#27ABE7"/> + <stop offset="0.9249" style="stop-color:#25A3E2"/> + <stop offset="0.9487" style="stop-color:#1797D8"/> + <stop offset="0.9728" style="stop-color:#0B83C3"/> + <stop offset="0.9969" style="stop-color:#256BA7"/> + <stop offset="1" style="stop-color:#2867A2"/> + </linearGradient> + <path class="st15" d="M73.2,35.1c-3-0.1-9.5-0.4-15.1-0.4C7.1,34.7,1.4,46.5,1.2,47C1,47.6,1,48.3,1,48.9v20.6 + c5-5,15.9-7.7,29.2-9.7c8.6-1.2,17.2-1.9,25.9-2c1.6,0,3.2,0,4.8,0C60.8,57.8,76.3,35.2,73.2,35.1z"/> + + <linearGradient id="SVGID_17_" gradientUnits="userSpaceOnUse" x1="50.3126" y1="432.0108" x2="28.2664" y2="428.9106" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2B3B6A"/> + <stop offset="1" style="stop-color:#2B3B6A"/> + </linearGradient> + <path class="st16" d="M44.1,33.5c-10.7,0.5-18.4,1.3-24.8,3.1l0.3,0.8c0.6-0.1,1.3-0.3,1.9-0.4c7.7-1.2,15.4-2,23.1-2.3L44.1,33.5 + z"/> + + <linearGradient id="SVGID_18_" gradientUnits="userSpaceOnUse" x1="72.7451" y1="450.8669" x2="10.4435" y2="442.1056" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2867A2"/> + <stop offset="3.820000e-02" style="stop-color:#2174B1"/> + <stop offset="0.1177" style="stop-color:#0B86C4"/> + <stop offset="0.2081" style="stop-color:#0A94D2"/> + <stop offset="0.3177" style="stop-color:#0C9BDB"/> + <stop offset="0.5" style="stop-color:#109EDE"/> + <stop offset="0.6823" style="stop-color:#0C9BDB"/> + <stop offset="0.7919" style="stop-color:#0A94D2"/> + <stop offset="0.8823" style="stop-color:#0B86C4"/> + <stop offset="0.9618" style="stop-color:#2174B1"/> + <stop offset="1" style="stop-color:#2867A2"/> + </linearGradient> + <path class="st17" d="M73.2,34.3c-3-0.1-9.5-0.4-15.1-0.4c-51.1,0-56.7,11.8-57,12.4C1,46.8,1,47.5,1,48.1v21.4 + c5-5,15.9-8.5,29.2-10.5c8.6-1.2,17.2-1.9,25.9-2c1.6,0,3.2,0,4.8,0C63.2,57.1,76.3,34.4,73.2,34.3z"/> + + <linearGradient id="SVGID_19_" gradientUnits="userSpaceOnUse" x1="101.6202" y1="407.733" x2="71.9933" y2="458.7571" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2867A2"/> + <stop offset="0.1238" style="stop-color:#177EBC"/> + <stop offset="0.2516" style="stop-color:#0E91D1"/> + <stop offset="0.3797" style="stop-color:#10A2E1"/> + <stop offset="0.5064" style="stop-color:#18ACEA"/> + <stop offset="0.631" style="stop-color:#24B1ED"/> + <stop offset="0.7513" style="stop-color:#28B1ED"/> + <stop offset="0.7911" style="stop-color:#24B1ED"/> + <stop offset="0.8324" style="stop-color:#18ACEA"/> + <stop offset="0.8743" style="stop-color:#10A2E1"/> + <stop offset="0.9167" style="stop-color:#0E91D1"/> + <stop offset="0.959" style="stop-color:#177EBC"/> + <stop offset="1" style="stop-color:#2867A2"/> + </linearGradient> + <path class="st18" d="M58.2,58.8C72.1,37.9,82.4,16,79.8,4.1l17.3,11c0.5,0.3,1,0.7,1.4,1.2c0.3,0.5,7.1,11.7-20.7,54.5 + c-2,3.2-3.9,6.9-4.6,7.2c-4.1-4-12.6-15.6-14.7-18.5C58.3,59.1,58.2,58.8,58.2,58.8z"/> + + <linearGradient id="SVGID_20_" gradientUnits="userSpaceOnUse" x1="105.3445" y1="433.3988" x2="94.5575" y2="453.6416" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2B3B6A"/> + <stop offset="1" style="stop-color:#2B3B6A"/> + </linearGradient> + <path class="st19" d="M96.6,37.2c-3.1,7.8-6.8,15.3-11.1,22.4l1.3,0.2c5.5-9.5,8.7-16.5,10.9-22.4L96.6,37.2z"/> + + <linearGradient id="SVGID_21_" gradientUnits="userSpaceOnUse" x1="100.6479" y1="408.8533" x2="70.927" y2="464.6275" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2867A2"/> + <stop offset="3.820000e-02" style="stop-color:#2174B1"/> + <stop offset="0.1177" style="stop-color:#0B86C4"/> + <stop offset="0.2081" style="stop-color:#0A94D2"/> + <stop offset="0.3177" style="stop-color:#0C9BDB"/> + <stop offset="0.5" style="stop-color:#109EDE"/> + <stop offset="0.6823" style="stop-color:#0C9BDB"/> + <stop offset="0.7919" style="stop-color:#0A94D2"/> + <stop offset="0.8823" style="stop-color:#0B86C4"/> + <stop offset="0.9618" style="stop-color:#2174B1"/> + <stop offset="1" style="stop-color:#2867A2"/> + </linearGradient> + <path class="st20" d="M78.5,71.4c27.8-42.8,21-54,20.7-54.5c-0.4-0.5-0.9-0.9-1.4-1.2L79.8,4.1c2.5,11.8-7.4,34.6-21.2,55.5 + c4.6,7.1,9.4,14,14.5,19.9C74.1,78.3,76.7,74.3,78.5,71.4z"/> + + <linearGradient id="SVGID_22_" gradientUnits="userSpaceOnUse" x1="102.9539" y1="410.1097" x2="72.9714" y2="466.375" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2867A2"/> + <stop offset="3.820000e-02" style="stop-color:#2174B1"/> + <stop offset="0.1177" style="stop-color:#0B86C4"/> + <stop offset="0.2081" style="stop-color:#0A94D2"/> + <stop offset="0.3177" style="stop-color:#0C9BDB"/> + <stop offset="0.5" style="stop-color:#109EDE"/> + <stop offset="0.6823" style="stop-color:#0C9BDB"/> + <stop offset="0.7919" style="stop-color:#0A94D2"/> + <stop offset="0.8823" style="stop-color:#0B86C4"/> + <stop offset="0.9618" style="stop-color:#2174B1"/> + <stop offset="1" style="stop-color:#2867A2"/> + </linearGradient> + <path class="st21" d="M72.6,80.2c0.1-0.1,0.2-0.1,0.2-0.2c-5.3-6.2-10.2-12.8-14.7-19.7c-0.1,0.1-0.2,0.2-0.2,0.4 + C57.9,60.6,67.6,75.9,72.6,80.2z"/> + + <linearGradient id="SVGID_23_" gradientUnits="userSpaceOnUse" x1="54.5637" y1="474.0854" x2="62.254" y2="494.9197" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2B3B6A"/> + <stop offset="1" style="stop-color:#2B3B6A"/> + </linearGradient> + <path class="st22" d="M58.2,98.4C57.9,98.1,47.7,86.1,43.1,79l-0.8,0.9C46.9,86.6,52,93,57.6,99L58.2,98.4z"/> + + <linearGradient id="SVGID_24_" gradientUnits="userSpaceOnUse" x1="69.1674" y1="452.6575" x2="78.2209" y2="509.0225" gradientTransform="matrix(1 0 0 1 -8.0854 -395.1333)"> + <stop offset="0" style="stop-color:#2E5284"/> + <stop offset="2.440000e-02" style="stop-color:#2C5C92"/> + <stop offset="8.880000e-02" style="stop-color:#2075B1"/> + <stop offset="0.1599" style="stop-color:#0B86C4"/> + <stop offset="0.2403" style="stop-color:#0A94D2"/> + <stop offset="0.3378" style="stop-color:#0E9CDA"/> + <stop offset="0.5" style="stop-color:#109EDE"/> + <stop offset="0.6718" style="stop-color:#0C9BDB"/> + <stop offset="0.7751" style="stop-color:#0A94D2"/> + <stop offset="0.8603" style="stop-color:#0B86C4"/> + <stop offset="0.9351" style="stop-color:#2174B1"/> + <stop offset="1" style="stop-color:#2C5D95"/> + </linearGradient> + <path class="st23" d="M72.9,79.9c-5.3-6.2-10.2-12.8-14.7-19.7c-0.5-0.8-1.1-1.6-1.6-2.4c-8.7,0-17.4,0.7-26,1.9 + c0.3,0.5,4.3,7.2,7.2,11.7c27.8,42.8,40.8,41.1,41.4,41c0.6-0.2,1.2-0.5,1.7-0.8L98.8,100C91.4,98.4,82.1,90.6,72.9,79.9z"/> + </g> +</g> +<circle + style="fill:#cc3939;stroke:none;stroke-width:1.08876" + id="path4540" + cx="97.204369" + cy="97.204346" + r="18.095627" /> +</svg> diff --git a/resources.qrc b/resources.qrc index 383d412ea..884215072 100644 --- a/resources.qrc +++ b/resources.qrc @@ -15,6 +15,8 @@ <file>images/FontAwesome.otf</file> <file>images/jami.ico</file> <file>images/jami.png</file> + <file>images/jami.svg</file> + <file>images/jami-new.svg</file> <file>images/spike.png</file> <file>images/waiting.gif</file> <file>images/icons/ic_add_black_18dp_2x.png</file> diff --git a/src/conversationsadapter.cpp b/src/conversationsadapter.cpp index 1466a1697..65b46090d 100644 --- a/src/conversationsadapter.cpp +++ b/src/conversationsadapter.cpp @@ -191,6 +191,7 @@ ConversationsAdapter::onNewUnreadInteraction(const QString& accountId, }; systemTray_->showNotification(interaction.body, from, onClicked); #endif + updateConversationFilterData(); } } @@ -237,6 +238,7 @@ ConversationsAdapter::onNewTrustRequest(const QString& accountId, Q_UNUSED(accountId) Q_UNUSED(peerUri) #endif + updateConversationFilterData(); } void @@ -349,6 +351,7 @@ ConversationsAdapter::updateConversationFilterData() } set_totalUnreadMessageCount(totalUnreadMessages); set_pendingRequestCount(accountInfo.conversationModel->pendingRequestCount()); + systemTray_->setCount(lrcInstance_->notificationsCount()); } void diff --git a/src/lrcinstance.cpp b/src/lrcinstance.cpp index 8f1060613..028ce40a0 100644 --- a/src/lrcinstance.cpp +++ b/src/lrcinstance.cpp @@ -115,6 +115,12 @@ LRCInstance::getActiveCalls() return lrc_->activeCalls(); } +int +LRCInstance::notificationsCount() const +{ + return lrc_->getAccountModel().notificationsCount(); +} + const account::Info& LRCInstance::getAccountInfo(const QString& accountId) { diff --git a/src/lrcinstance.h b/src/lrcinstance.h index 7e572ab9f..b4e1b2f78 100644 --- a/src/lrcinstance.h +++ b/src/lrcinstance.h @@ -83,6 +83,7 @@ public: bool isConnected(); void connectivityChanged(); VectorString getActiveCalls(); + int notificationsCount() const; const account::Info& getAccountInfo(const QString& accountId); const account::Info& getCurrentAccountInfo(); diff --git a/src/mainapplication.cpp b/src/mainapplication.cpp index 3fde86358..af7bcb343 100644 --- a/src/mainapplication.cpp +++ b/src/mainapplication.cpp @@ -491,7 +491,7 @@ MainApplication::initQmlLayer() void MainApplication::initSystray() { - systemTray_->setIcon(QIcon(":images/jami.png")); + systemTray_->setIcon(QIcon(":images/jami.svg")); QMenu* systrayMenu = new QMenu(); diff --git a/src/systemtray.cpp b/src/systemtray.cpp index f99596080..644c7c699 100644 --- a/src/systemtray.cpp +++ b/src/systemtray.cpp @@ -137,6 +137,16 @@ SystemTray::~SystemTray() hide(); } +void +SystemTray::setCount(int count) +{ + if (count == 0) { + setIcon(QIcon(":images/jami.svg")); + } else { + setIcon(QIcon(":images/jami-new.svg")); + } +} + #ifdef Q_OS_LINUX bool SystemTray::hideNotification(const QString& id) @@ -242,9 +252,9 @@ SystemTray::showNotification(const QString& message, setOnClickedCallback(std::move(onClickedCb)); if (from.isEmpty()) - showMessage(message, "", QIcon(":images/jami.png")); + showMessage(message, "", QIcon(":images/jami.svg")); else - showMessage(from, message, QIcon(":images/jami.png")); + showMessage(from, message, QIcon(":images/jami.svg")); } template<typename Func> diff --git a/src/systemtray.h b/src/systemtray.h index 523bc31a2..142a8b655 100644 --- a/src/systemtray.h +++ b/src/systemtray.h @@ -37,6 +37,7 @@ public: explicit SystemTray(AppSettingsManager* settingsManager, QObject* parent = nullptr); ~SystemTray(); + void setCount(int count); #ifdef Q_OS_LINUX bool hideNotification(const QString& id); void showNotification(const QString& id, -- GitLab