Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanek Bevendorff <janek@jbev.net>2021-01-31 14:52:45 +0300
committerJanek Bevendorff <janek@jbev.net>2021-01-31 16:54:51 +0300
commit48f2efbc921f0b9fce461dca4c2abf4643be5511 (patch)
treeb8f111429f879906cbd29f975860495dbc090b5f
parentf7d387d2335ee826e2c758c170734c884fa2b90d (diff)
Fix adaptive icon painting (backport)
Fixes resolution problems on HighDPI. Backport of c7323accf2a004293a67bb06ff0eb9a692903f35
-rw-r--r--src/core/Resources.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/core/Resources.cpp b/src/core/Resources.cpp
index 2976f9a25..66aa07f8e 100644
--- a/src/core/Resources.cpp
+++ b/src/core/Resources.cpp
@@ -179,15 +179,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();