[Panel-devel] [PATCH] fix resizing applets

Robert Knight robertknight at gmail.com
Sat Sep 1 18:13:42 CEST 2007


Hi Sebastian,

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) )

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.

Regards,
Robert.

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?
> --
> sebas
>
>  http://www.kde.org | http://vizZzion.org |  GPG Key ID: 9119 0EF9
>


More information about the Panel-devel mailing list