Allow higher resolution of thumbnails on Welcome Screen

Before this commit, all thumbnails on the Welcome Screen had the resolution of 200x200 pixels, even when Krita had a higher scale factor and the widget itself was 400x400 pixels (for example on Android, where high pixel density is common). This commit ensures that the device pixel ratio is taken into account when making thumbnails. It allows for sharper images on the Welcome Screen.

This shouldn't make it much more slower or anything, the same files are being opened, just the thumbnail is scaled down to 400x400 instead of 200x200 if the user is using 2x scale (or 300x300 if 1.5 scale etc.).

It's something you notice, even on Android where pixels are in theory tiny, and higher quality recent images just look better.

Test Plan

  1. Make a high fidelity/resolution image with sharp details, make sure it's in the Recent Images.
  2. Open Krita with "QT_SCALE_FACTOR=2"
  3. Before this MR, it should look blurry. (If you make a screenshot, you'll see that the pixels on the pixmaps are correctly scaled, but it's clearly 200x200 images being scaed up to 400x400)
  4. After this MR, it should look much more defined/sharp.

(Click on the image to compare before/after)

recent_images_before recent_images_after

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
  • Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?

Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.

Edited by Agata Cacko

Merge request reports

Loading