Bug 478576

Summary: Plasma 6 System Tray Applet - Ability to set scaleIconsToFit through API Scripting
Product: [Plasma] plasmashell Reporter: Frank <frankebay99>
Component: System Tray widgetAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: wishlist CC: fanzhuyifan, materka
Priority: NOR Keywords: qt6
Version First Reported In: 5.90.0   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Scale Icons

Description Frank 2023-12-15 19:31:05 UTC
Created attachment 164209 [details]
Scale Icons

SUMMARY
***
We use Plasma API Scripting for our distro’s Global Theme and setting the property "scaleIconToFit" in the systray is becoming more important with time.

There are use cases where this is interesting, because it keeps a consistent size along with other icons like Task Manager. There is a vast array of screen resolutions used nowadays, therefore building a Theme for say 1920x1080 resolution doesn't make this aspect transient seamlessly for someone using it in a say 3840x2160 resolution, because the systray icons are set to Small no matter the Y pixel resolution. It it is also very handy for those who often switch from say a big 2160 external monitor to a lower 1080 laptop monitor.

I have read many documentations like https://develop.kde.org/docs/plasma/scripting/api/#applets-containments-and-widgets but no matter what I try to code in layout.js it does not apply that setting.


STEPS TO REPRODUCE
1. Use code in script following documentation above
2. Apply the Theme

OBSERVED RESULT
In ~/.config/plasma-org.kde.plasma.desktop-appletsrc the config is written in a different group/subgroup, with "Applets", so it doesn't set the property.

===
[Containments][1][Applets][9][Configuration]
===


EXPECTED RESULT
The second to last line should be written in the below Group:

===
[Containments][10][General]
extraItems=org.kde.kdeconnect,org.kde.kscreen,org.kde.plasma.battery,org.kde.plasma.bluetooth,org.kde.plasma.clipboard,org.kde.plasma.devicenotifier,org.kde.plasma.keyboardindicator,org.kde.plasma.keyboardlayout,org.kde.plasma.manage-inputmethod,org.kde.plasma.mediacontroller,org.kde.plasma.networkmanagement,org.kde.plasma.nightcolorcontrol,org.kde.plasma.notifications,org.kde.plasma.volume
knownItems=org.kde.kdeconnect,org.kde.kscreen,org.kde.plasma.battery,org.kde.plasma.bluetooth,org.kde.plasma.clipboard,org.kde.plasma.devicenotifier,org.kde.plasma.keyboardindicator,org.kde.plasma.keyboardlayout,org.kde.plasma.manage-inputmethod,org.kde.plasma.mediacontroller,org.kde.plasma.networkmanagement,org.kde.plasma.nightcolorcontrol,org.kde.plasma.notifications,org.kde.plasma.volume
scaleIconsToFit=true
shownItems=org.kde.plasma.volume,org.kde.plasma.battery
===



SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch
KDE Plasma Version: 5.90.90
KDE Frameworks Version: 5.247
Qt Version: 6.6.1