[Panel-devel] [PATCH] fix resizing applets

Sebastian Kügler sebas at kde.org
Sat Sep 1 18:38:15 CEST 2007


On Saturday 01 September 2007 18:13:42 Robert Knight wrote:
> The changes in the patch are incorrect.  contentSizeHint() is an
> 'ideal' size for the applet, not the actual size.  The actual size is
> given by contentSize().  If applets want to change their own size they
> can call setGeometry().
>
> eg. setGeometry( QRectF(geometry().topLeft() , newSize) )

Ok. I'll give that a try.

> However, this will mess up applets when they are used in layouts.  I
> think a better solution would be for the desktop to have a layout
> which does not place applets in any specific order (ie. lets them move
> around freely) but updates applets' size to sizeHint() when it
> changes.  Applets can notify parent layouts when their desired size
> changes by calling updateGeometry().  This then (as with Qt's widget
> stack) invokes a top-down relayout of widgets.

My understanding was that this is what formfactors are for. If the layout 
places size constraints on the applet, it should indicate that by setting the 
formfactor for the applet to e.g. HorizontalPanel. Applets on the desktop 
have the Desktop formfactor. The sizing for applets in both formfactors would 
then be independent, this is already the case for the digiclock. 

The size for the various formfactors is currently hardcoded, but maybe it 
should be the panel (layout) that controls it from the 'outside'. I'm 
assuming the panel does not already set the formfactor (which didn't seem to 
be the case).

> On 01/09/07, Sebastian Kügler <sebas at kde.org> wrote:
> > After the contentSize changes, resizing of the applets is broken. With
> > the attached patch, it works for the the analog clock, the dict and the
> > batteryapplet again.
> >
> > OK to commit?

Thanks,
-- 
sebas

 http://www.kde.org | http://vizZzion.org |  GPG Key ID: 9119 0EF9 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20070901/510d0f89/attachment.pgp 


More information about the Panel-devel mailing list