@@ -16,10 +16,11 @@ namespace {
1616class FontIconEngine : public QIconEngine
1717{
1818public:
19- FontIconEngine (FontIcon::FontFamily family, QChar glyph, FontIcon::Size size)
19+ FontIconEngine (FontIcon::FontFamily family, QChar glyph, FontIcon::Size size, const QColor &color = OCC::Resources::tint() )
2020 : _family(family)
2121 , _glyph(glyph)
2222 , _size(size)
23+ , _color(color)
2324 {
2425 }
2526
@@ -29,7 +30,7 @@ class FontIconEngine : public QIconEngine
2930 painter->setRenderHint (QPainter::Antialiasing);
3031
3132 auto pen = painter->pen ();
32- pen.setColor (OCC::Resources::tint () );
33+ pen.setColor (_color );
3334 painter->setPen (pen);
3435
3536 auto font = painter->font ();
@@ -83,16 +84,17 @@ class FontIconEngine : public QIconEngine
8384 return pixmap;
8485 }
8586
86- QIconEngine *clone () const override { return new FontIconEngine (this ->_family , this ->_glyph , this ->_size ); }
87+ QIconEngine *clone () const override { return new FontIconEngine (this ->_family , this ->_glyph , this ->_size , this -> _color ); }
8788
8889 QString pixmapKey (const QSize &size, QIcon::Mode mode, QIcon::State state)
8990 {
90- return QStringLiteral (" FontIcon:%1" ).arg (QString::number (qHashMulti (0 , _family, _glyph, _size, size, mode, state), 16 ));
91+ return QStringLiteral (" FontIcon:%1" ).arg (QString::number (qHashMulti (0 , _family, _glyph, _size, _color. rgb (), size, mode, state), 16 ));
9192 }
9293
9394 const FontIcon::FontFamily _family;
9495 const QChar _glyph;
9596 const FontIcon::Size _size;
97+ const QColor _color;
9698};
9799}
98100
0 commit comments