Browse Source

[QT] don't colorize icons on win and mac

0.13
Jonas Schnelli 10 years ago
parent
commit
ca5f688547
  1. 10
      src/qt/scicon.cpp

10
src/qt/scicon.cpp

@ -27,12 +27,17 @@ static void MakeSingleColorImage(QImage& img, const QColor& colorbase)
QImage SingleColorImage(const QString& filename, const QColor& colorbase) QImage SingleColorImage(const QString& filename, const QColor& colorbase)
{ {
QImage img(filename); QImage img(filename);
#if !defined(WIN32) && !defined(MAC_OSX)
MakeSingleColorImage(img, colorbase); MakeSingleColorImage(img, colorbase);
#endif
return img; return img;
} }
QIcon SingleColorIcon(const QIcon& ico, const QColor& colorbase) QIcon SingleColorIcon(const QIcon& ico, const QColor& colorbase)
{ {
#if defined(WIN32) || defined(MAC_OSX)
return ico;
#else
QIcon new_ico; QIcon new_ico;
QSize sz; QSize sz;
Q_FOREACH(sz, ico.availableSizes()) Q_FOREACH(sz, ico.availableSizes())
@ -42,6 +47,7 @@ QIcon SingleColorIcon(const QIcon& ico, const QColor& colorbase)
new_ico.addPixmap(QPixmap::fromImage(img)); new_ico.addPixmap(QPixmap::fromImage(img));
} }
return new_ico; return new_ico;
#endif
} }
QIcon SingleColorIcon(const QString& filename, const QColor& colorbase) QIcon SingleColorIcon(const QString& filename, const QColor& colorbase)
@ -51,6 +57,9 @@ QIcon SingleColorIcon(const QString& filename, const QColor& colorbase)
QColor SingleColor() QColor SingleColor()
{ {
#if defined(WIN32) || defined(MAC_OSX)
return QColor(0,0,0);
#else
const QColor colorHighlightBg(QApplication::palette().color(QPalette::Highlight)); const QColor colorHighlightBg(QApplication::palette().color(QPalette::Highlight));
const QColor colorHighlightFg(QApplication::palette().color(QPalette::HighlightedText)); const QColor colorHighlightFg(QApplication::palette().color(QPalette::HighlightedText));
const QColor colorText(QApplication::palette().color(QPalette::WindowText)); const QColor colorText(QApplication::palette().color(QPalette::WindowText));
@ -61,6 +70,7 @@ QColor SingleColor()
else else
colorbase = colorHighlightFg; colorbase = colorHighlightFg;
return colorbase; return colorbase;
#endif
} }
QIcon SingleColorIcon(const QString& filename) QIcon SingleColorIcon(const QString& filename)

Loading…
Cancel
Save