A screen shot and a question
Marco Martin
notmart at gmail.com
Tue Sep 16 10:11:36 CEST 2008
On Tuesday 16 September 2008, Dong Tiger wrote:
> Hi all,
>
> I tried to make Google Gadgets(GG in short) to work on plasma panel. Here
> is a screen shot of a vertical panel with 3 GGs. But there are still issues
> remain:
>
> 1. It doesn't work on horizontal panel. When added to horizontal panel, the
> applet gets a 'invalid' constraintsEvent with width constaint of 9 ( In my
> case). So the embedded GG just doesn't show up at all.
strange, you are getting a SizeConstraint combined with a
FormFactorConstraint, so in that call formFactor() should be the right one
(Horizontal), maybe seeing the code would help :)
> 2. I can't adjust the size of an applet when it's on panel. I am using
> Plasma::ConstrainedSquare for these applets.
constrainedSquare means that the applet for instance in an horizontal panel
can have a width at max equal to the panel height, but can be automatically
resized by the panel layout. in general you can't never ever call resize() in
the constraintevent when you are in the panel (or in a layout in general)
because it would collide with the automatic layout resize, thus causing an
infinite loop of resizing and 100%cpu usage...
to set the size in a panel you should make it IgnoreAspectRatio and then set
minimum and maximum sizes, but this is quite ugly and error prone when the
panel switches run-time from vertical to horizontal.
So what would do is the following: make them popupapplets, so in the panel
will only show an icon, and what i would like to do is making popupapplet
automatically switch to full view when in the panel there is enugh room, bit
off topic here but a patch will follow soon :)
in general, i don't know exactly how google gadget works, but if these applets
have some way to gracefully reduce themselves also in very tiny sized
constraints without weird rendering errors you can keep them as normal
applets, otherwise PopupApplets could be safer.
Cheers,
Marco Martin
>
> Any suggestion to solve these problems?
>
>
> Regards,
> --
> Tiger
More information about the Plasma-devel
mailing list