fallback availabiluty icons, chatty icon

This commit is contained in:
Blue 2019-06-24 00:09:39 +03:00
parent 833913cac2
commit 12511b1864
18 changed files with 399 additions and 51 deletions

View File

@ -1,5 +1,8 @@
#include "global.h" #include "global.h"
#include <uuid/uuid.h> #include <uuid/uuid.h>
#include <QApplication>
#include <QPalette>
#include <QIcon>
Shared::Message::Message(Shared::Message::Type p_type): Shared::Message::Message(Shared::Message::Type p_type):
jFrom(), jFrom(),
@ -252,3 +255,15 @@ void Shared::Message::setCurrentTime()
time = QDateTime::currentDateTime(); time = QDateTime::currentDateTime();
} }
QIcon Shared::availabilityIcon(Shared::Availability av, bool big)
{
const std::deque<QString>& fallback = QApplication::palette().window().color().lightnessF() > 0.5 ?
big ?
Shared::fallbackAvailabilityThemeIconsDarkBig:
Shared::fallbackAvailabilityThemeIconsDarkSmall:
big ?
Shared::fallbackAvailabilityThemeIconsLightBig:
Shared::fallbackAvailabilityThemeIconsLightSmall;
return QIcon::fromTheme(availabilityThemeIcons[av], QIcon(fallback[av]));
}

View File

@ -47,7 +47,7 @@ static const std::deque<QString> availabilityThemeIcons = {
"user-away", "user-away",
"user-away-extended", "user-away-extended",
"user-busy", "user-busy",
"user-online", "chatty",
"user-invisible", "user-invisible",
"user-offline" "user-offline"
}; };
@ -120,6 +120,48 @@ private:
bool forwarded; bool forwarded;
}; };
static const std::deque<QString> fallbackAvailabilityThemeIconsLightBig = {
":images/fallback/light/big/online.svg",
":images/fallback/light/big/away.svg",
":images/fallback/light/big/absent.svg",
":images/fallback/light/big/busy.svg",
":images/fallback/light/big/chatty.svg",
":images/fallback/light/big/invisible.svg",
":images/fallback/light/big/offline.svg"
};
static const std::deque<QString> fallbackAvailabilityThemeIconsLightSmall = {
":images/fallback/light/small/online.svg",
":images/fallback/light/small/away.svg",
":images/fallback/light/small/absent.svg",
":images/fallback/light/small/busy.svg",
":images/fallback/light/small/chatty.svg",
":images/fallback/light/small/invisible.svg",
":images/fallback/light/small/offline.svg"
};
static const std::deque<QString> fallbackAvailabilityThemeIconsDarkBig = {
":images/fallback/dark/big/online.svg",
":images/fallback/dark/big/away.svg",
":images/fallback/dark/big/absent.svg",
":images/fallback/dark/big/busy.svg",
":images/fallback/dark/big/chatty.svg",
":images/fallback/dark/big/invisible.svg",
":images/fallback/dark/big/offline.svg"
};
static const std::deque<QString> fallbackAvailabilityThemeIconsDarkSmall = {
":images/fallback/dark/small/online.svg",
":images/fallback/dark/small/away.svg",
":images/fallback/dark/small/absent.svg",
":images/fallback/dark/small/busy.svg",
":images/fallback/dark/small/chatty.svg",
":images/fallback/dark/small/invisible.svg",
":images/fallback/dark/small/offline.svg"
};
QIcon availabilityIcon(Availability av, bool big = false);
}; };
#endif // GLOBAL_H #endif // GLOBAL_H

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 24 24"
id="svg2"
version="1.1"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
sodipodi:docname="chatty.svg">
<metadata
id="metadata18">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs16" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1864"
inkscape:window-height="1051"
id="namedview14"
showgrid="true"
inkscape:zoom="8"
inkscape:cx="-51.392389"
inkscape:cy="3.9675745"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg2">
<inkscape:grid
type="xygrid"
id="grid4155" />
</sodipodi:namedview>
<path
style="fill:#00ccff"
d="m 12,4 c -2.2091257,-5.5e-6 -3.9999834,1.7908522 -4,4 1.66e-5,2.209148 1.7908743,4.000006 4,4 2.209126,6e-6 3.999983,-1.790852 4,-4 -1.7e-5,-2.2091478 -1.790874,-4.0000055 -4,-4 z m 0,1 c 1.656843,0 2.999983,1.3431409 3,3 -1.7e-5,1.6568591 -1.343157,3 -3,3 -1.656843,0 -2.9999834,-1.3431409 -3,-3 1.66e-5,-1.6568591 1.343157,-3 3,-3 z m 0,8 c -4.0279789,0.0048 -7.4242263,3.003572 -7.9277344,7 H 5.0800781 C 5.5767373,16.559083 8.5234608,14.004092 12,14 c 0.33482,0.0027 0.669011,0.0295 1,0.08008 V 13.070312 C 12.668464,13.025992 12.334475,13.002509 12,13 Z m 4.5,0 C 14.567003,13 13,14.567003 13,16.5 13,18.432997 14.567003,20 16.5,20 18.432997,20 20,18.432997 20,16.5 20,14.567003 18.432997,13 16.5,13 Z"
id="path8"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccscscscccccccsssss" />
<g
id="g16">
<path
sodipodi:nodetypes="scccsss"
inkscape:connector-curvature="0"
id="path11"
d="m 16.521484,13.646781 c -0.550005,-4e-6 -1.004591,0.4418 -1.004248,0.994141 L 15.519436,16 c 0.0015,0.556279 0.455413,1.000026 1.003906,1 0.552285,0 0.997241,-0.441858 0.996094,-0.994141 l -0.0028,-1.364937 c -0.0012,-0.558377 -0.442832,-0.994136 -0.995117,-0.994141 z"
style="fill:#ffffff" />
<path
id="path45-6"
d="m 14.4375,16 a 2.0634756,2.0634756 0 0 0 1.03125,1.787109 2.0634756,2.0634756 0 0 0 2.0625,0 A 2.0634756,2.0634756 0 0 0 18.5625,16 H 18 a 1.5,1.5 0 0 1 -0.75,1.298828 1.5,1.5 0 0 1 -1.5,0 A 1.5,1.5 0 0 1 15,16 Z"
style="fill:#ffffff;stroke-width:1.37565041"
inkscape:connector-curvature="0" />
<path
id="rect63"
d="m 16,18 v 0.679688 h 1 V 18 Z"
style="fill:#ffffff"
inkscape:connector-curvature="0" />
<rect
y="18.65803"
x="15"
height="0.34197077"
width="3"
id="rect65"
style="fill:#ffffff" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 16 16"
version="1.1"
id="svg6"
sodipodi:docname="chatty.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1864"
inkscape:window-height="1051"
id="namedview8"
showgrid="false"
inkscape:zoom="256"
inkscape:cx="6.6014924"
inkscape:cy="11.315493"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg6" />
<path
style="fill:#00ccff;stroke-width:0.85776705"
d="M 8,2 C 6.3419388,2 4.9978162,3.3441236 4.9978162,5.0021846 c 0,1.6580613 1.3441226,3.0021849 3.0021838,3.0021849 1.6580611,0 3.002185,-1.3441236 3.002185,-3.0021849 C 11.002185,3.3441236 9.6580611,2 8,2 Z m 0.018425,0.5545326 c 0.473732,4.4e-6 0.8533874,0.3737841 0.8544167,0.8527415 l 0.00171,1.1710527 C 8.8755006,5.0520569 8.4938362,5.4310683 8.0201043,5.4310683 7.5496251,5.4310906 7.1602727,5.050459 7.158986,4.5733012 L 7.1572705,3.4072741 C 7.1569762,2.9334941 7.5466118,2.5545292 8.018388,2.5545326 Z M 6.2308555,4.5733012 h 0.4824939 c 6.44e-5,0.4596113 0.2452896,0.8842858 0.6433253,1.1140918 0.3980914,0.2298379 0.8885592,0.2298379 1.2866506,0 C 9.0413609,5.457587 9.2865862,5.0329125 9.2866506,4.5733012 h 0.482494 C 9.7692578,5.2055947 9.4320687,5.789928 8.8845722,6.1062244 8.7418956,6.1879697 8.5885251,6.2494278 8.4288835,6.2888353 V 6.8534201 H 9.2866506 V 7.1466023 H 6.7133494 V 6.8534201 H 7.5711165 V 6.2888353 C 7.4114749,6.2494295 7.2581044,6.1879663 7.1154277,6.1062244 6.5679313,5.789928 6.2307422,5.2055947 6.2308555,4.5733012 Z"
id="path8"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ssssscccccccccsscccccccccccccc" />
<path
d="m 8,9 c -2.761,0 -5,2.01 -5,4.5 10e-4,0.167 0.012,0.334 0.033,0.5 h 9.93 C 12.986,13.834 12.998,13.667 13,13.5 13,11.015 10.761,9 8,9 m 0,1 c 1.987,0.002 3.671,1.279 3.955,3 H 4.045 C 4.329,11.279 6.013,10.002 8,10"
id="path2"
inkscape:connector-curvature="0"
style="fill:#00ccff"
sodipodi:nodetypes="cccccccccc" />
<g
transform="matrix(0.85736427,0,0,0.85736427,-6.1495694,-9.1457294)"
id="g16">
<path
sodipodi:nodetypes="scccsss"
inkscape:connector-curvature="0"
id="path11"
d="m 16.521484,13.646781 c -0.550005,-4e-6 -1.004591,0.4418 -1.004248,0.994141 L 15.519436,16 c 0.0015,0.556279 0.455413,1.000026 1.003906,1 0.552285,0 0.997241,-0.441858 0.996094,-0.994141 l -0.0028,-1.364937 c -0.0012,-0.558377 -0.442832,-0.994136 -0.995117,-0.994141 z"
style="fill:#ffffff" />
<path
id="path45-6"
d="m 14.4375,16 a 2.0634756,2.0634756 0 0 0 1.03125,1.787109 2.0634756,2.0634756 0 0 0 2.0625,0 A 2.0634756,2.0634756 0 0 0 18.5625,16 H 18 a 1.5,1.5 0 0 1 -0.75,1.298828 1.5,1.5 0 0 1 -1.5,0 A 1.5,1.5 0 0 1 15,16 Z"
style="fill:#ffffff;stroke-width:1.37565041"
inkscape:connector-curvature="0" />
<path
id="rect63"
d="m 16,18 v 0.679688 h 1 V 18 Z"
style="fill:#ffffff"
inkscape:connector-curvature="0" />
<rect
y="18.65803"
x="15"
height="0.34197077"
width="3"
id="rect65"
style="fill:#ffffff" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 24 24"
id="svg2"
version="1.1"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
sodipodi:docname="chatty.svg">
<metadata
id="metadata18">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs16" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1864"
inkscape:window-height="1051"
id="namedview14"
showgrid="true"
inkscape:zoom="45.254834"
inkscape:cx="18.460026"
inkscape:cy="8.7147643"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg2">
<inkscape:grid
type="xygrid"
id="grid4155" />
</sodipodi:namedview>
<path
style="fill:#00ccff"
d="m 12,4 c -2.2091257,-5.5e-6 -3.9999834,1.7908522 -4,4 1.66e-5,2.209148 1.7908743,4.000006 4,4 2.209126,6e-6 3.999983,-1.790852 4,-4 -1.7e-5,-2.2091478 -1.790874,-4.0000055 -4,-4 z m 0,1 c 1.656843,0 2.999983,1.3431409 3,3 -1.7e-5,1.6568591 -1.343157,3 -3,3 -1.656843,0 -2.9999834,-1.3431409 -3,-3 1.66e-5,-1.6568591 1.343157,-3 3,-3 z m 0,8 C 7.9720211,13.0048 4.5757737,16.003572 4.0722656,20 H 5.0800781 C 5.5767373,16.559083 8.5234608,14.004092 12,14 c 0.33482,0.0027 0.669011,0.0295 1,0.08008 V 13.070312 C 12.668464,13.025993 12.334475,13.002509 12,13 Z m 4.5,0 C 14.567003,13 13,14.567003 13,16.5 13,18.432997 14.567003,20 16.5,20 18.432997,20 20,18.432997 20,16.5 20,14.567003 18.432997,13 16.5,13 Z m 0.02148,0.646484 c 0.552285,5e-6 0.994894,0.435764 0.996094,0.994141 l 0.002,1.365234 C 17.520678,16.558142 17.075723,17 16.523438,17 c -0.548493,2.6e-5 -1.002407,-0.443721 -1.003907,-1 l -0.002,-1.359375 c -3.43e-4,-0.552341 0.453901,-0.994145 1.003906,-0.994141 z M 14.4375,16 H 15 c 7.5e-5,0.535823 0.285963,1.030916 0.75,1.298828 0.464102,0.267949 1.035898,0.267949 1.5,0 C 17.714037,17.030916 17.999925,16.535823 18,16 h 0.5625 c 1.32e-4,0.737139 -0.392969,1.418365 -1.03125,1.787109 C 17.364915,17.882405 17.186113,17.954058 17,18 v 0.658203 h 1 V 19 h -3 v -0.341797 h 1 V 18 C 15.813887,17.954058 15.635085,17.882405 15.46875,17.787109 14.830469,17.418365 14.437368,16.737139 14.4375,16 Z"
id="path8"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccscscscccccccssssscccccccccssccccccccccccc" />
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 16 16"
version="1.1"
id="svg6"
sodipodi:docname="chatty.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1864"
inkscape:window-height="1051"
id="namedview8"
showgrid="false"
inkscape:zoom="256"
inkscape:cx="6.6014924"
inkscape:cy="11.315493"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg6" />
<path
style="fill:#00ccff;stroke-width:0.85776705"
d="M 8,2 C 6.3419388,2 4.9978162,3.3441236 4.9978162,5.0021846 c 0,1.6580613 1.3441226,3.0021849 3.0021838,3.0021849 1.6580611,0 3.002185,-1.3441236 3.002185,-3.0021849 C 11.002185,3.3441236 9.6580611,2 8,2 Z m 0.018425,0.5545326 c 0.473732,4.4e-6 0.8533874,0.3737841 0.8544167,0.8527415 l 0.00171,1.1710527 C 8.8755006,5.0520569 8.4938362,5.4310683 8.0201043,5.4310683 7.5496251,5.4310906 7.1602727,5.050459 7.158986,4.5733012 L 7.1572705,3.4072741 C 7.1569762,2.9334941 7.5466118,2.5545292 8.018388,2.5545326 Z M 6.2308555,4.5733012 h 0.4824939 c 6.44e-5,0.4596113 0.2452896,0.8842858 0.6433253,1.1140918 0.3980914,0.2298379 0.8885592,0.2298379 1.2866506,0 C 9.0413609,5.457587 9.2865862,5.0329125 9.2866506,4.5733012 h 0.482494 C 9.7692578,5.2055947 9.4320687,5.789928 8.8845722,6.1062244 8.7418956,6.1879697 8.5885251,6.2494278 8.4288835,6.2888353 V 6.8534201 H 9.2866506 V 7.1466023 H 6.7133494 V 6.8534201 H 7.5711165 V 6.2888353 C 7.4114749,6.2494295 7.2581044,6.1879663 7.1154277,6.1062244 6.5679313,5.789928 6.2307422,5.2055947 6.2308555,4.5733012 Z"
id="path8"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ssssscccccccccsscccccccccccccc" />
<path
d="m 8,9 c -2.761,0 -5,2.01 -5,4.5 10e-4,0.167 0.012,0.334 0.033,0.5 h 9.93 C 12.986,13.834 12.998,13.667 13,13.5 13,11.015 10.761,9 8,9 m 0,1 c 1.987,0.002 3.671,1.279 3.955,3 H 4.045 C 4.329,11.279 6.013,10.002 8,10"
id="path2"
inkscape:connector-curvature="0"
style="fill:#00ccff"
sodipodi:nodetypes="cccccccccc" />
<g
transform="matrix(0.85736427,0,0,0.85736427,-6.1495694,-9.1457294)"
id="g16">
<path
sodipodi:nodetypes="scccsss"
inkscape:connector-curvature="0"
id="path11"
d="m 16.521484,13.646781 c -0.550005,-4e-6 -1.004591,0.4418 -1.004248,0.994141 L 15.519436,16 c 0.0015,0.556279 0.455413,1.000026 1.003906,1 0.552285,0 0.997241,-0.441858 0.996094,-0.994141 l -0.0028,-1.364937 c -0.0012,-0.558377 -0.442832,-0.994136 -0.995117,-0.994141 z"
style="fill:#ffffff" />
<path
id="path45-6"
d="m 14.4375,16 a 2.0634756,2.0634756 0 0 0 1.03125,1.787109 2.0634756,2.0634756 0 0 0 2.0625,0 A 2.0634756,2.0634756 0 0 0 18.5625,16 H 18 a 1.5,1.5 0 0 1 -0.75,1.298828 1.5,1.5 0 0 1 -1.5,0 A 1.5,1.5 0 0 1 15,16 Z"
style="fill:#ffffff;stroke-width:1.37565041"
inkscape:connector-curvature="0" />
<path
id="rect63"
d="m 16,18 v 0.679688 h 1 V 18 Z"
style="fill:#ffffff"
inkscape:connector-curvature="0" />
<rect
y="18.65803"
x="15"
height="0.34197077"
width="3"
id="rect65"
style="fill:#ffffff" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -1,30 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!-- Created using Karbon, part of Calligra: http://www.calligra.org/karbon -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="226.772pt" height="226.772pt">
<defs>
<radialGradient id="gradient0" gradientTransform="" gradientUnits="objectBoundingBox" cx="0.58615583000" cy="0.59764384000" fx="0.50130301000" fy="0.61237523000" r="0.20615528000" spreadMethod="pad">
<stop stop-color="#ffffff" offset="0.00000000000" stop-opacity="1.00000000000"/>
<stop stop-color="#000000" offset="1.00000000000" stop-opacity="1.00000000000"/>
</radialGradient>
</defs>
<g id="layer0">
<circle id="shape0" transform="" r="141.77696241071pt" cx="141.77696241071pt" cy="141.77696241071pt" fill="#eeeb1d" fill-rule="evenodd" stroke="#000000" stroke-width="0.08503951740" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="1.98425543308"/>
<g id="group1" transform="translate(9.42515, 20.0683)" fill="none">
<path id="shape011" transform="translate(2.52126, 94.3639)" fill="#000000" stroke="#000000" stroke-width="0.08503951740" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="1.98425543308" d="M13.7868 0C-20.9371 78.2947 12.9209 116.755 81.8766 143.344C48.803 118.318 32.2243 85.1265 48.5476 54.976C64.273 54.0712 74.4022 43.6486 80.7554 6.77087C33.4537 22.7045 23.9698 15.2213 13.7868 0Z"/>
<path id="shape11" transform="translate(53.5583, 120.504)" fill="#000000" stroke="#000000" stroke-width="0.08503951740" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="1.98425543308" d="M0.0390336 58.446C-0.508311 75.2636 4.7451 82.4194 13.0006 85.5591C34.384 87.3033 50.5845 94.036 74.434 80.7171C57.4285 30.9273 43.246 -6.13342 33.0083 0.845797C16.5859 22.1898 11.1668 38.7359 12.8331 45.1781C13.5421 59.3808 8.40203 61.4802 0.0390336 58.446Z"/>
<path id="shape21" transform="translate(83.7751, 97.1079)" fill="#000000" stroke="#000000" stroke-width="0.08503951740" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="1.98425543308" d="M0 3.78934C43.6707 -12.5736 40.4801 24.6091 44.0695 104.631C34.8369 79.9436 14.9955 14.3809 2.59232 24.4808C7.7105 16.3152 11.2991 -0.457864 0 3.78934Z"/>
<path id="shape0111" transform="translate(15.3567, 2.5221)" fill="#000000" fill-rule="evenodd" stroke="#000000" stroke-width="0.08503951740" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="1.98425543308" d="M1.23284 90.4967C-14.9544 20.581 131.833 -73.2611 231.831 92.5541C242.22 109.781 258.019 153.619 219.727 200.121C193.561 231.085 113.877 219.786 112.107 198.418C104.974 126.503 110.945 79.4203 67.6202 98.7319C16.153 116.631 5.48982 104.606 1.23284 90.4967Z"/>
<path id="shape41" transform="matrix(0.999941 -0.0542578 -0.0233262 1.00088 63.2155 35.119)" fill="#000000" stroke="#000000" stroke-width="0.08503951740" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="1.98425543308" d="M56.4822 20.8524C37.7279 17.7726 29.039 -0.164137 21.1057 0.00113486C9.2061 0.249044 -0.226559 10.6804 0.00414314 21.5251C0.234845 32.3699 5.76072 43.0697 20.4852 43.049C35.2097 43.0283 37.8631 26.2335 56.4822 20.8524Z"/>
<ellipse id="shape31" transform="matrix(0.970618 -0.245439 0.175175 0.985449 71.9055 47.4623)" rx="8.09592848986pt" ry="9.16421234126pt" cx="8.09592848986pt" cy="9.16421234126pt" fill="#000000" fill-rule="evenodd" stroke="#000000" stroke-width="0.08503951740" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="1.98425543308"/>
</g>
<g id="group11" transform="translate(17.2933, 13.7078)" fill="none">
<path id="shape01111" transform="translate(3.18245, 95.0383)" fill="#2e2e2e" stroke="#000000" stroke-width="1.41732529000" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="2.00000000000" d="M13.6826 0C-20.7789 78.0736 12.8233 116.425 81.2579 142.939C48.4342 117.984 31.9808 84.8861 48.1808 54.8208C63.7873 53.9186 73.84 43.5254 80.1452 6.75174C33.201 22.6404 23.7886 15.1784 13.6826 0Z"/>
<path id="shape111" transform="translate(54.2195, 121.178)" fill="#2e2e2e" stroke="#000000" stroke-width="1.41732529000" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="2.00000000000" d="M0.038739 58.4844C-0.504475 75.313 4.70929 82.4735 12.9025 85.6153C34.1245 87.3606 50.2028 94.0977 73.8723 80.7701C56.9951 30.9477 42.9197 -6.13745 32.7592 0.846351C16.4607 22.2043 11.0825 38.7613 12.7363 45.2078C13.4399 59.4199 8.33862 61.5206 0.038739 58.4844Z"/>
<path id="shape211" transform="translate(84.4363, 97.7813)" fill="#dfa700" stroke="#000000" stroke-width="1.41732529000" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="2.00000000000" d="M0 3.77601C43.9897 -12.5294 40.7758 24.5227 44.3914 104.264C35.0913 79.6628 15.105 14.3304 2.61126 24.3949C7.76681 16.2578 11.3816 -0.456263 0 3.77601Z"/>
<path id="shape01111" transform="translate(16.1292, 11.8595)" fill="#005ddf" fill-rule="evenodd" stroke="#000000" stroke-width="1.41732529000" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="2.00000000000" d="M1.12308 82.0153C-15.0847 11.9593 148.305 -64.3242 222.188 89.9488C228.508 107.46 218.746 127.737 205.802 147.297C179.603 178.323 164.705 188.623 112.139 190.153C104.997 118.094 110.975 70.9167 67.5949 90.2671C16.0622 108.202 5.38548 96.1539 1.12308 82.0153Z"/>
<path id="shape411" transform="translate(63.3722, 34.6296)" fill="#dfa700" stroke="#000000" stroke-width="1.41732529000" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="2.00000000000" d="M56.7239 19.2268C37.966 17.1261 29.6656 -0.584886 21.6961 0.0148868C9.74219 0.914534 0.0246784 12.0039 8.52215e-05 22.9858C-0.0245092 33.9678 5.27104 44.5144 20.0558 43.6912C34.8409 42.868 37.9017 25.6966 56.7239 19.2268Z"/>
<path id="shape311" transform="matrix(0.970618 -0.245439 0.175175 0.985449 72.5667 48.1365)" fill="url(#gradient0)" fill-rule="evenodd" stroke="#000000" stroke-width="1.25000000000" stroke-linecap="square" stroke-linejoin="miter" stroke-miterlimit="2.00000000000" d="M20.2398 11.4553C20.2398 5.1287 15.709 3.87391e-16 10.1199 0C4.53084 -3.87391e-16 6.84464e-16 5.1287 0 11.4553C-6.84464e-16 17.7818 4.53084 22.9105 10.1199 22.9105C15.709 22.9105 20.2398 17.7818 20.2398 11.4553"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -9,6 +9,7 @@
<file>images/fallback/dark/big/offline.svg</file> <file>images/fallback/dark/big/offline.svg</file>
<file>images/fallback/dark/big/online.svg</file> <file>images/fallback/dark/big/online.svg</file>
<file>images/fallback/dark/big/user.svg</file> <file>images/fallback/dark/big/user.svg</file>
<file>images/fallback/dark/big/chatty.svg</file>
<file>images/fallback/dark/small/absent.svg</file> <file>images/fallback/dark/small/absent.svg</file>
<file>images/fallback/dark/small/away.svg</file> <file>images/fallback/dark/small/away.svg</file>
@ -17,6 +18,7 @@
<file>images/fallback/dark/small/offline.svg</file> <file>images/fallback/dark/small/offline.svg</file>
<file>images/fallback/dark/small/online.svg</file> <file>images/fallback/dark/small/online.svg</file>
<file>images/fallback/dark/small/user.svg</file> <file>images/fallback/dark/small/user.svg</file>
<file>images/fallback/dark/small/chatty.svg</file>
<file>images/fallback/light/big/absent.svg</file> <file>images/fallback/light/big/absent.svg</file>
<file>images/fallback/light/big/away.svg</file> <file>images/fallback/light/big/away.svg</file>
@ -25,6 +27,7 @@
<file>images/fallback/light/big/offline.svg</file> <file>images/fallback/light/big/offline.svg</file>
<file>images/fallback/light/big/online.svg</file> <file>images/fallback/light/big/online.svg</file>
<file>images/fallback/light/big/user.svg</file> <file>images/fallback/light/big/user.svg</file>
<file>images/fallback/light/big/chatty.svg</file>
<file>images/fallback/light/small/absent.svg</file> <file>images/fallback/light/small/absent.svg</file>
<file>images/fallback/light/small/away.svg</file> <file>images/fallback/light/small/away.svg</file>
@ -33,5 +36,6 @@
<file>images/fallback/light/small/offline.svg</file> <file>images/fallback/light/small/offline.svg</file>
<file>images/fallback/light/small/online.svg</file> <file>images/fallback/light/small/online.svg</file>
<file>images/fallback/light/small/user.svg</file> <file>images/fallback/light/small/user.svg</file>
<file>images/fallback/light/small/chatty.svg</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -42,7 +42,7 @@ Conversation::Conversation(Models::Contact* p_contact, QWidget* parent):
m_ui->splitter->setStretchFactor(1, 0); m_ui->splitter->setStretchFactor(1, 0);
setName(p_contact->getContactName()); setName(p_contact->getContactName());
setState(p_contact->getAvailability()); updateState();
setStatus(p_contact->getStatus()); setStatus(p_contact->getStatus());
connect(contact, SIGNAL(childChanged(Models::Item*, int, int)), this, SLOT(onContactChanged(Models::Item*, int, int))); connect(contact, SIGNAL(childChanged(Models::Item*, int, int)), this, SLOT(onContactChanged(Models::Item*, int, int)));
@ -106,10 +106,10 @@ void Conversation::setName(const QString& name)
line->setPalName(getJid(), name); line->setPalName(getJid(), name);
} }
void Conversation::setState(Shared::Availability state) void Conversation::updateState()
{ {
m_ui->statusIcon->setPixmap(QIcon::fromTheme(Shared::availabilityThemeIcons[state]).pixmap(50)); m_ui->statusIcon->setPixmap(contact->getStatusIcon(true).pixmap(40));
m_ui->statusIcon->setToolTip(Shared::availabilityNames[state]); m_ui->statusIcon->setToolTip(Shared::availabilityNames[contact->getAvailability()]);
} }
void Conversation::setStatus(const QString& status) void Conversation::setStatus(const QString& status)
@ -135,7 +135,7 @@ void Conversation::onContactChanged(Models::Item* item, int row, int col)
setName(contact->getContactName()); setName(contact->getContactName());
break; break;
case 3: case 3:
setState(contact->getAvailability()); updateState();
break; break;
case 5: case 5:
setStatus(contact->getStatus()); setStatus(contact->getStatus());

View File

@ -65,7 +65,7 @@ signals:
void shown(); void shown();
protected: protected:
void setState(Shared::Availability state); void updateState();
void setStatus(const QString& status); void setStatus(const QString& status);
void setName(const QString& name); void setName(const QString& name);
void applyVisualEffects(); void applyVisualEffects();

View File

@ -69,12 +69,12 @@ void Models::Account::setAvailability(Shared::Availability p_avail)
} }
} }
QIcon Models::Account::getStatusIcon() const QIcon Models::Account::getStatusIcon(bool big) const
{ {
if (state == Shared::connected) { if (state == Shared::connected) {
return QIcon::fromTheme(Shared::availabilityThemeIcons[availability]); return Shared::availabilityIcon(availability, big);
} else if (state == Shared::disconnected) { } else if (state == Shared::disconnected) {
return QIcon::fromTheme(Shared::availabilityThemeIcons[Shared::offline]); return Shared::availabilityIcon(Shared::offline, big);
} else { } else {
return QIcon::fromTheme(Shared::connectionStateThemeIcons[state]); return QIcon::fromTheme(Shared::connectionStateThemeIcons[state]);
} }

View File

@ -36,7 +36,7 @@ namespace Models {
void setAvailability(unsigned int p_avail); void setAvailability(unsigned int p_avail);
Shared::Availability getAvailability() const; Shared::Availability getAvailability() const;
QIcon getStatusIcon() const; QIcon getStatusIcon(bool big = false) const;
QVariant data(int column) const override; QVariant data(int column) const override;
int columnCount() const override; int columnCount() const override;

View File

@ -216,12 +216,12 @@ void Models::Contact::setState(Shared::SubscriptionState p_state)
} }
} }
QIcon Models::Contact::getStatusIcon() const QIcon Models::Contact::getStatusIcon(bool big) const
{ {
if (getMessagesCount() > 0) { if (getMessagesCount() > 0) {
return QIcon::fromTheme("mail-message"); return QIcon::fromTheme("mail-message");
} else if (state == Shared::both) { } else if (state == Shared::both) {
return QIcon::fromTheme(Shared::availabilityThemeIcons[availability]); return Shared::availabilityIcon(availability, big);;
} else { } else {
return QIcon::fromTheme(Shared::subscriptionStateThemeIcons[state]); return QIcon::fromTheme(Shared::subscriptionStateThemeIcons[state]);
} }

View File

@ -22,7 +22,7 @@ public:
QString getJid() const; QString getJid() const;
Shared::Availability getAvailability() const; Shared::Availability getAvailability() const;
Shared::SubscriptionState getState() const; Shared::SubscriptionState getState() const;
QIcon getStatusIcon() const; QIcon getStatusIcon(bool big = false) const;
int columnCount() const override; int columnCount() const override;
QVariant data(int column) const override; QVariant data(int column) const override;

View File

@ -140,12 +140,12 @@ void Models::Presence::dropMessages()
} }
} }
QIcon Models::Presence::getStatusIcon() const QIcon Models::Presence::getStatusIcon(bool big) const
{ {
if (getMessagesCount() > 0) { if (getMessagesCount() > 0) {
return QIcon::fromTheme("mail-message"); return QIcon::fromTheme("mail-message");
} else { } else {
return QIcon::fromTheme(Shared::availabilityThemeIcons[availability]); return Shared::availabilityIcon(availability, big);
} }
} }

View File

@ -46,7 +46,7 @@ public:
QString getStatus() const; QString getStatus() const;
void setStatus(const QString& p_state); void setStatus(const QString& p_state);
QIcon getStatusIcon() const; QIcon getStatusIcon(bool big = false) const;
void update(const QString& key, const QVariant& value); void update(const QString& key, const QVariant& value);
unsigned int getMessagesCount() const; unsigned int getMessagesCount() const;

View File

@ -76,17 +76,17 @@ QVariant Models::Roster::data (const QModelIndex& index, int role) const
switch (item->type) { switch (item->type) {
case Item::account:{ case Item::account:{
Account* acc = static_cast<Account*>(item); Account* acc = static_cast<Account*>(item);
result = acc->getStatusIcon(); result = acc->getStatusIcon(false);
} }
break; break;
case Item::contact:{ case Item::contact:{
Contact* contact = static_cast<Contact*>(item); Contact* contact = static_cast<Contact*>(item);
result = contact->getStatusIcon(); result = contact->getStatusIcon(false);
} }
break; break;
case Item::presence:{ case Item::presence:{
Presence* presence = static_cast<Presence*>(item); Presence* presence = static_cast<Presence*>(item);
result = presence->getStatusIcon(); result = presence->getStatusIcon(false);
} }
break; break;
default: default:

View File

@ -16,8 +16,9 @@ Squawk::Squawk(QWidget *parent) :
m_ui->roster->setModel(&rosterModel); m_ui->roster->setModel(&rosterModel);
m_ui->roster->setContextMenuPolicy(Qt::CustomContextMenu); m_ui->roster->setContextMenuPolicy(Qt::CustomContextMenu);
const std::deque<QString>& fallback = palette().window().color().lightnessF() > 0.5 ? Shared::fallbackAvailabilityThemeIconsDarkSmall : Shared::fallbackAvailabilityThemeIconsLightSmall;
for (int i = 0; i < Shared::availabilityNames.size(); ++i) { for (int i = 0; i < Shared::availabilityNames.size(); ++i) {
m_ui->comboBox->addItem(QIcon::fromTheme(Shared::availabilityThemeIcons[i]), Shared::availabilityNames[i]); m_ui->comboBox->addItem(QIcon::fromTheme(Shared::availabilityThemeIcons[i], QIcon(fallback[i])), Shared::availabilityNames[i]);
} }
m_ui->comboBox->setCurrentIndex(Shared::offline); m_ui->comboBox->setCurrentIndex(Shared::offline);