From c7323accf2a004293a67bb06ff0eb9a692903f35 Mon Sep 17 00:00:00 2001 From: smlu Date: Sun, 24 Jan 2021 22:52:42 +0100 Subject: [PATCH] Fix adaptive icon painting --- src/gui/Icons.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/gui/Icons.cpp b/src/gui/Icons.cpp index 1b40a3fe9..e64be65c5 100644 --- a/src/gui/Icons.cpp +++ b/src/gui/Icons.cpp @@ -117,16 +117,8 @@ AdaptiveIconEngine::AdaptiveIconEngine(QIcon baseIcon) void AdaptiveIconEngine::paint(QPainter* painter, const QRect& rect, QIcon::Mode mode, QIcon::State state) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) - double dpr = !kpxcApp->testAttribute(Qt::AA_UseHighDpiPixmaps) ? 1.0 : painter->device()->devicePixelRatioF(); -#else - double dpr = !kpxcApp->testAttribute(Qt::AA_UseHighDpiPixmaps) ? 1.0 : painter->device()->devicePixelRatio(); -#endif - QSize pixmapSize = rect.size() * dpr; - painter->save(); - painter->drawPixmap(rect, m_baseIcon.pixmap(pixmapSize, mode, state)); - + m_baseIcon.paint(painter, rect, Qt::AlignCenter, mode, state); if (getMainWindow()) { QPalette palette = getMainWindow()->palette(); painter->setCompositionMode(QPainter::CompositionMode_SourceAtop);