D7849: Fix the tray icon scaling on HiDPI screens

Piotr Kosinski noreply at phabricator.kde.org
Sun Sep 17 15:04:19 UTC 2017


pgkos added a comment.


  @broulik consider this case:
  
  The tray icons' size is defined by default in `org.kde.plasma.private.systemtray/contents/config/main.xml` to `smallMedium`, which means 22 pixels on a 96-dpi screen. On a 192-dpi screen, the icons' real size is 44 pixels.
  Now, in `org.kde.plasma.private.systemtray/contents/ui/main.qml` there is this line:
  
    units.roundToIconSize(Math.min(Math.min(width, height), units.iconSizes[iconSizes[plasmoid.configuration.iconSize]]))
  
  The `height` property is the height of the panel (assuming the panel is horizontal). On my hidpi screen the default panel height is around 72 pixels (`32 px * 2`).
  
  So the above line evaluates to:
  `units.roundToIconSize(Math.min(72, units.iconSizes.smallMedium))`
  `units.roundToIconSize(Math.min(72, 44))`
  `units.roundToIconSize(44)`
  
  and that gets rounded to `medium` size, which is incorrect, because we want a `smallMedium` size multiplied by two (`32 px != 22 px * 2`).
  
  So, on a hidpi screen the `roundToIconSize` function returns a wrong size, and additionally it (wrongly) does not multiply the size by the icon dpi scaling factor (e.g. `2.0`).

REVISION DETAIL
  https://phabricator.kde.org/D7849

To: pgkos, #plasma
Cc: broulik, #frameworks, davidedmundson, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170917/354cd1cc/attachment.html>


More information about the Plasma-devel mailing list