summary refs log tree commit diff
path: root/src/ColorImageProvider.cpp
diff options
context:
space:
mode:
authorq234rty <q23456yuiop@gmail.com>2022-06-28 20:14:23 +0800
committerGitHub <noreply@github.com>2022-06-28 12:14:23 +0000
commit7a295317397d5e49b66c39605c6529d99660691c (patch)
tree5039c4f69d6d68a879b7138a75fd2b7205fc84f1 /src/ColorImageProvider.cpp
parentFix clazy complaint about detatch (diff)
downloadnheko-7a295317397d5e49b66c39605c6529d99660691c.tar.xz
Fix blurriness of svg icons (#1108)
Diffstat (limited to 'src/ColorImageProvider.cpp')
-rw-r--r--src/ColorImageProvider.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ColorImageProvider.cpp b/src/ColorImageProvider.cpp
index 74e9eff7..6a38c46c 100644
--- a/src/ColorImageProvider.cpp
+++ b/src/ColorImageProvider.cpp
@@ -5,10 +5,11 @@
 
 #include "ColorImageProvider.h"
 
+#include <QIcon>
 #include <QPainter>
 
 QPixmap
-ColorImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &)
+ColorImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &req)
 {
     auto args = id.split('?');
 
@@ -17,6 +18,8 @@ ColorImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &)
     if (size)
         *size = QSize(source.width(), source.height());
 
+    if (req.width() > 0 && req.height() > 0)
+        source = QIcon(args[0]).pixmap(req);
     if (args.size() < 2)
         return source;