Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit e827fa08 authored by David Edmundson's avatar David Edmundson

Fix app icon button in window decos with high DPI in previews.

With both Qt devicePixelRatio > 1 and Qt::AA_UseHighDpiPixmaps set
QIcon.pixmap() will return a bigger image than the size requested, with
the relevant devicePixelRatio set.

This code is trying to center an icon within a bounding rect, (like
QStyle::drawItemPixmap) and so positioning should use normalised pixels,
not actual pixmap pixels.

This affected Systemsettings previews but not kwin.

Reviewers: #plasma, mart

Reviewed By: #plasma, mart

Subscribers: mart, plasma-devel

Tags: #plasma

Differential Revision:
parent e02fef08
......@@ -137,7 +137,7 @@ namespace Breeze
const QRectF iconRect( geometry().topLeft(), m_iconSize );
const QPixmap pixmap = decoration()->client().data()->icon().pixmap( m_iconSize );
painter->drawPixmap( - QPoint(pixmap.width()/2, pixmap.height()/2), pixmap);
painter->drawPixmap( - QPoint(pixmap.width()/2, pixmap.height()/2)/pixmap.devicePixelRatio(), pixmap);
} else {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment