Desktop: Remove 'renderSVGIcon' methods.

Remove `renderSVGIcon()` and `renderSVGIconWidth()`, as QPixmaps can be
loaded directly from SVG, and support scaling.

Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
Michael Keller 2023-05-29 00:21:52 +12:00 committed by Dirk Hohndel
parent 2ef6cd89cc
commit 7ee5b10810
6 changed files with 15 additions and 37 deletions

View file

@ -36,8 +36,6 @@
#include <QFont>
#include <QApplication>
#include <QTextDocument>
#include <QPainter>
#include <QSvgRenderer>
#include <cstdarg>
#include <cstdint>
#ifdef Q_OS_UNIX
@ -1687,26 +1685,3 @@ extern "C" void emit_reset_signal()
{
emit diveListNotifier.dataReset();
}
QImage renderSVGIcon(const char *id, int size, bool transparent)
{
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);
return res;
}
// As renderSVGIcon(), but render to a fixed width and scale height accordingly
// and have a transparent background.
QImage renderSVGIconWidth(const char *id, int size)
{
QSvgRenderer svg{QString(id)};
QSize svgSize = svg.defaultSize();
QImage res(size, size * svgSize.height() / svgSize.width(), QImage::Format_ARGB32);
res.fill(Qt::transparent);
QPainter painter(&res);
svg.render(&painter);
return res;
}