![]() Registered Member ![]()
|
Hi All,
maybe someone of you can help me. Since the good old KNewsTicker died, i took some time and reanimated it and rewrote parts of it to work on KDE 4.2+. You can find it [url="http://kde-apps.org/content/show.php/NetNewsTicker?content=101699"]here.[/url] But on KDE 4.3 RC2 i ran into sizing problems if the applet is put onto a panel. If i put the applet on a panel, the applet takes up the whole panel, this is correct. But sometimes the plasma-desktop crashes and when it comes back, the applet only takes up ~10% of the panel. In my source code i use the call
in my paintInterface(...) method. This call causes that my applet eats up all available space on the panel (at least i think it does). But it won't work after plasma is restarted. The workaround is to remove the applet, restart plasma-desktop and then readd the applet again. I guess this is not a problem of kde 4.3 itself, but a problem of my code. Since i never really found out on how to handle the resizing of applets the way it should be. Can anyone please advise me a good tutorial on using the correct sizing technique? Or someone can tell me where i'm wrong? Many thanks in advance Greetings, -chris-
Last edited by chrizz on Mon Jul 27, 2009 7:23 am, edited 1 time in total.
|
![]() Administrator ![]()
|
Size policy does not need to be set each time, it should be done in the constructor, or when you perform initial setup of the plasmoid.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Thanks for your comment. But your suggested way does not work for me. If i set the policy in the constructor or in the initialization, nothing will happen and the applet stays very small.
I tried this before since i thought, setting the policy on every paint is very redundant. Greetings, -chris- |
![]() Administrator ![]()
|
Just checked your code...
it appears you are not calling resize() anywhere.... or setAspectRatioMode(). you may wish to try adding them to your constructor. Try moving setSizePolicy() into the init() function also. You should be able to change the following line:
to the following also:
There seem to be a few headers included that aren't actually needed also.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Thanks again, but it won't work.
Even if i do
in the initialization, the applet always shows up only on ~10% of the space in the panel. There are no additional applets in the panel. If i add a "variable spacer" to the panel, all works nearly the way it's expected. But i guess it should work also without any other applet. Maybe i should look in the source code for the "variable spacer" and check what 'magic' they do to get the correct behaviour. Do you know where i find this code. I looked through the websvn.kde.org but didn't find this piece of code. Greetings, -chris- |
![]() Administrator ![]()
|
It will be located in /trunk/KDE/kdebase/workspace/plasma/applets.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
I think i found the sufficient solution.
I put
in the ctor and now the sizing problems are gone. Maybe the default aspect ratio of an applet is to keep the ratio. But i really don't know why my applet now works. Sadly i did not find any good documentation how the sizing of an applet is handled by plasma. Many thanks for your help!! Greetings, -chris- |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]