Fix thumbnail alignment in grid view for small icons

Previously, KFileItemDelegate ignored the displayAlignment option and hardcoded the drawing of the thumbnail to the top-left corner of the grid cell. This caused small previews to sit completely off-center.

This calculates the actual pixmap size and adds an X/Y offset to properly center the icon within the allocated decoration size.

Before:

-Image and video thumbnails are vertically aligned towards the top and horizontally pushed to the left.

before.png

After:

Now, image and video thumbnails are both horizontally and vertically center aligned in the file picker

Screenshot_20260604_190708.png

BUG: 520659

Edited by John Doe

Merge request reports

Loading