core: add "transparent" parameter to renderSVGIcon

The start-selection widget will need icons with a transparent
background so that the icons don't stick out like a sore thumb.

So far the icons rendered by this function were only used by
the images on the profile and were perfectly rectangular.
Therefore there was no need for this.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-01 01:32:03 +01:00 committed by bstoeger
parent 60999e3a39
commit b0b52d51bd
3 changed files with 8 additions and 8 deletions

View file

@ -1704,10 +1704,10 @@ extern "C" void emit_reset_signal()
emit diveListNotifier.dataReset();
}
QImage renderSVGIcon(const char *id, int size)
QImage renderSVGIcon(const char *id, int size, bool transparent)
{
QImage res(size, size, QImage::Format_RGB32);
res.fill(Qt::white);
QImage res(size, size, transparent ? QImage::Format_ARGB32 : QImage::Format_RGB32);
res.fill(transparent ? Qt::transparent : Qt::white);
QSvgRenderer svg{QString(id)};
QPainter painter(&res);
svg.render(&painter);