![]() Registered Member ![]()
|
I want to create right-aligned horizontal panel, fill it with widgets and set it's length just enough to display all of them. I was not able to find panel's property "autosize" or similar to. So I supposed that I had to set the panel's length equal to sum of widths of all widgets added to the panel. This code should do that:
But it does it in a wrong way. On the picture below top panel is created manually, and bottom one — by this script: ![]() As you can see, the bottom panel is longer than it should be. After inspecting the script's run log I've got that widget.geometry.width, which I used to determine widget's width, does not represent widget's visual width, e. g. first four widgets should have nearly equal widths, but there's an appreciable dispersion, and system tray's width is displayed as the smallest, while the tray itself is the longest from the widgets added. But what should I use instead of geometry.width then? Thanks in advance. |
![]() Administrator ![]()
|
I would suggest asking about this on the Plasma Development mailing list (plasma-devel@kde.org), as the width/height properties to use have been a source of problems in the past. If you get a solution, please post it here.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
I've talked to Aaron Seigo, and he adviced to set panel min length's value to something less than needed, and panel max length equal to screen width. The problem is that max/min length properties used to be inaccessible via plasma script, but recently Seigo has implemented them there, so now that should work.
UPD: This will work only with scriptingVersion ≥ 7. There's still 6th one in KDE 4.11 and SC 4.12. UPD2: KDE 4.12 release brings plasma scriptingVersion 7. "minLength"/"maxLength" available and work okay. |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]