friction2d / friction

Friction Graphics
https://friction.graphics
GNU General Public License v3.0
183 stars 10 forks source link

Pixelized icons on HiDPI displays #91

Closed prokoudine closed 1 month ago

prokoudine commented 7 months ago

According to #3, the program generates PNG images from SVG and then loads them. Unfortunately, it doesn't look like pixel density is taken into consideration when doing so. So on HiDPI displays icons look pixelized. Essentially, low-resolution icons get blown up to fit their containers.

image

rodlie commented 7 months ago

This is a Qt issue IMHO, I supply an icon-theme (with all sizes) and use QIcon::fromTheme, what icon size Qt picks I don't know.

rodlie commented 7 months ago

One possible solution would be to supply only one (large) icon size in the icon theme, it should in theory look good with HiDPI and be scaled down on regular scaling?

rodlie commented 7 months ago

So, the issue was easier than I thought. We have to say to Qt that we want hidpi pixmaps for QIcons. friction-icon-hidpi

Note that this only works where we use QIcon. The timeline and properties still uses pixmap functions from enve (does not support hidpi).

So, issue #3 must be completed before all icons are hidpi-aware.