dolphinsmalltalk / Dolphin

Dolphin Smalltalk Core Image
MIT License
301 stars 58 forks source link

7.2 High DPI: Icons in List/Tree/Tab views may be scaled to odd sizes #1291

Closed blairmcg closed 3 months ago

blairmcg commented 3 months ago

The images in Iconic lists (i.e. ListView, TreeView and TabView) are scaled linearly from standard 96-dpi design sizes as appropriate for the DPI scaling of the view. For example the extent for a small icon at 225% (216 dpi) is calculated as follows:

(16@16) * 216 // 96 "=>" (36@36)

This "odd" size will cause the icon to be rendered by scaling down from the next size up, which would typically be 48x48. For the most part this doesn't look too bad, since scaling down products better quality results than scaling up. In some cases it can result in visible distortions of the image though, or it may be that the larger icon has a different graphic that isn't appropriate at a smaller size.

To Reproduce

  1. On a monitor at 225% scaling, open a class browser
  2. Find the CommandButton class
  3. Observe that the icon is rectangular but rather small with a lot of blank space around it

Actual

image

Expected

image

Discussion

The images should be sized to the nearest native icon size to avoid any scale-down. E.g. in the 225% example, the 32x32 icon should be used for "small icon" mode.