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

Authored by davidedmundson on Jul 17 2017, 10:22 PM.



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.

Diff Detail

R31 Breeze
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: Plasma. · View Herald TranscriptJul 17 2017, 10:22 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart accepted this revision.Jul 18 2017, 11:06 AM
mart added a subscriber: mart.
mart added inline comments.

couldn't also need a check that the resulting ratio is at least 1 or more?

This revision is now accepted and ready to land.Jul 18 2017, 11:06 AM
This revision was automatically updated to reflect the committed changes.