aboutsummaryrefslogtreecommitdiffstats
path: root/core/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-01 01:32:03 +0100
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2021-01-01 21:10:10 +0100
commitb0b52d51bdb093b7c2200d40ec41e2c3b0f2c830 (patch)
tree5602f5c7b48b7a3b2be9326b0e86e7a2f3fcdc53 /core/qthelper.cpp
parent60999e3a3933919e873337df8a74d9fab26bc2cf (diff)
downloadsubsurface-b0b52d51bdb093b7c2200d40ec41e2c3b0f2c830.tar.gz
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>
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r--core/qthelper.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index bebed3cf6..4f21f59c8 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -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);