Changeset View
Changeset View
Standalone View
Standalone View
src/qt/platformstyle.cpp
Show All 30 Lines | |||||
namespace { | namespace { | ||||
/* Local functions for colorizing single-color images */ | /* Local functions for colorizing single-color images */ | ||||
void MakeSingleColorImage(QImage &img, const QColor &colorbase) { | void MakeSingleColorImage(QImage &img, const QColor &colorbase) { | ||||
img = img.convertToFormat(QImage::Format_ARGB32); | img = img.convertToFormat(QImage::Format_ARGB32); | ||||
for (int x = img.width(); x--;) { | for (int x = img.width(); x--;) { | ||||
for (int y = img.height(); y--;) { | for (int y = img.height(); y--;) { | ||||
const QRgb rgb = img.pixel(x, y); | const QRgb rgb = img.pixel(x, y); | ||||
img.setPixel(x, y, qRgba(colorbase.red(), colorbase.green(), | img.setPixel(x, y, | ||||
qRgba(colorbase.red(), colorbase.green(), | |||||
colorbase.blue(), qAlpha(rgb))); | colorbase.blue(), qAlpha(rgb))); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
QIcon ColorizeIcon(const QIcon &ico, const QColor &colorbase) { | QIcon ColorizeIcon(const QIcon &ico, const QColor &colorbase) { | ||||
QIcon new_ico; | QIcon new_ico; | ||||
for (QSize sz : ico.availableSizes()) { | for (QSize sz : ico.availableSizes()) { | ||||
QImage img(ico.pixmap(sz).toImage()); | QImage img(ico.pixmap(sz).toImage()); | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |