[Icon Item] Round size we want to load a pixmap in
ClosedPublic

Authored by broulik on Jan 9 2017, 10:42 AM.

Details

Summary

QML sizes can be fractional. In case we're asked to load a 31.5 px pixmap it would truncate it to 31 and then round down to 22 causing a blurry result. Instead, round the size.

Test Plan

Fixes blurry media controls in task manager for me.

Problem is also that the new aspect-ratio aware IconItem always scales the pixmap up to its size regardless of the pixmap size. In any case this patch still makes sense imho

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik updated this revision to Diff 9901.Jan 9 2017, 10:42 AM
broulik retitled this revision from to [Icon Item] Round size we want to load a pixmap in.
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added a reviewer: Plasma.
broulik set the repository for this revision to R242 Plasma Framework (Library).
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptJan 9 2017, 10:42 AM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript

Just tested and this solves pixelated launcher icons, i.e. https://bugs.kde.org/show_bug.cgi?id=374707

It seems there have been problems with this before the new aspect-ratio aware IconItem aswell. See https://bugs.kde.org/show_bug.cgi?id=365326

Could your patch also solve this issue? Then we need to backport it to 5.8.

davidedmundson accepted this revision.Jan 9 2017, 11:29 PM
davidedmundson added a reviewer: davidedmundson.
davidedmundson added a subscriber: davidedmundson.

though typically we do rounding in the QML side as it can cause these problems with some other items too.

This revision is now accepted and ready to land.Jan 9 2017, 11:29 PM
This revision was automatically updated to reflect the committed changes.