[Folder View] Improve file name text rendering

Authored by broulik on Jul 19 2018, 3:09 PM.



GridView pads out its delegate to ensure a uniform grid. This, however, causes items to be placed on fractional pixels, leading to blurry rendering and uneven hinting.
Instead of adjusting padding calculation to return whole pixels, which will again cause a gap at the right side of the screen, since there's 20 icons in a row, slightly shift the delegate contents to move them back to whole pixels.
Moreover, DropShadow renders the entire item with a drop shadow, so keeping the Label visible results in two labels ontop of each other leading to bolder text.

Test Plan
  • Verified with gamma ray that the Label is now placed at integer scene coordinates
  • Font rendering does look a lot nicer, especially in second and lines further down
  • Verified that in software rendering Label renders fine just without a shadow
  • Verified that label hides when renaming file
  • Verified gap at the right of the screen is virtually unchanged

Diff Detail

R119 Plasma Desktop
Lint Skipped
Unit Tests Skipped
broulik created this revision.Jul 19 2018, 3:09 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 19 2018, 3:09 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Jul 19 2018, 3:09 PM
broulik updated this revision to Diff 38097.Jul 19 2018, 3:13 PM
  • Don't even bother creating the DropShadow if not supported
Zren added a subscriber: Zren.Jul 19 2018, 6:09 PM

I tested the x: -main.x % 1 code.



ngraham accepted this revision.Jul 19 2018, 8:43 PM

Looks better with fractional scaling and doesn't regress at all for 1x scaling. Drop shadows are still rendered. Code looks good.

This revision is now accepted and ready to land.Jul 19 2018, 8:43 PM
hein added a comment.Jul 20 2018, 8:00 AM

It kind of sucks we have to do this, we have a lot of different UIs we'd have to copy-paste this fix too, but after a few minutes of mulling I didn't come up with a better idea :/

This revision was automatically updated to reflect the committed changes.