Things look bad when a bitmap icon appears in the tray... (e.g. Remmina) It seems roundToIconSize is necessary for bitmap icons.
- Queries
- All Stories
- Search
- Advanced Search
Advanced Search
Feb 15 2018
With this new version the tray icons scale exactly like the application icons on the left (the "jumps" between icon sizes happen at exactly the same time).
Cancel out the enlargement of AbstractItem by the tasksRow's marginHints.
Feb 14 2018
It seems the problem is not with SVG icons, but with the systemtray code. If I make the systemtray's Flow's marginHints zero, the padding is preserved correctly! No magic constant is needed anymore:
//Do spacing with margins, to correctly compute the number of lines property QtObject marginHints: QtObject { property int left: Math.round(0) property int top: Math.round(0) property int right: Math.round(0) property int bottom: Math.round(0) }
There is something wrong and inconstent about SVG icon scaling. For example, if I put this line in systemtray ui main QML code instead:
I have returned to the previous version, as the version which used units.smallSpacing looked awful.
Fix the previous commit
Return to previous version, which was better.
Feb 13 2018
Use units.smallSpacing for padding instead of magic numbers.
I have tried and tested this diff without any padding, and trust me, it looks very bad - I would rather have this patch not accepted - than not to add any padding.
I could argue that the numbers come from Material Design guidelines - it recommends between 10% to 20% of padding around icons.
So maybe you tell me where this comes from? https://cgit.kde.org/plasma-workspace.git/commit/applets/digital-clock/package/contents/ui/DigitalClock.qml?id=90ea27f49c84f0dffbbf79b29eaa14c57f31a24d
I have tested it with the panel in both horizontal and vertical orientations, and 0.85 looks optimal for me.
Squashed the commits
Make the padding of all the panel icons the same
This patch also enables the user to configure the tray icon's size limit using System Settings -> Icons -> Advanced -> Panel
The 0.8 is used to create a small padding, so the icons never touch the panel's borders.
Fix tray icon scaling
Feb 10 2018
In my opinion, roundToIconSize should operate on scaled units - it is used multiple times in a few plasmoids - all calls from them to roundToIconSize assume it will operate on scaled units.
This is a simpler implementation - the diff changes roundToIconSize so it uses scaled units.
Sep 17 2017
@anthonyfieroni my first version of the diff changed only the tray icon QML file, but I think that it is better to fix it in the plasma framework, as that function is used in multiple other places and there is the same problem with wrongly sized icons on hidpi screens.
@broulik consider this case:
Fixed the previous diff.
Sep 16 2017
Edited the function Units::roundToIconSize so it both accepts and outputs a dpi-scaled pixel value.