[Panel-devel] [PATCH] fix resizing applets

Aaron J. Seigo aseigo at kde.org
Sat Sep 1 21:49:16 CEST 2007


On Saturday 01 September 2007, 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) )
>
> However, this will mess up applets when they are used in layouts.  I

*sigh*

> to have a layout which does not place applets

which means it isn't a layout at all but an external geometry manager which 
responds to sizeHint()s being set which really are setGeometry()s except 
we've fucked things up so badly elsewhere with layouts that we're now faced 
with introducing a layout that isn't a layout. genius!

> but updates applets' size to sizeHint() when it changes

so when an applet is in a layout it needs to set sizeHint() instead of 
setGeometry(), but when they aren't in a layout it needs to call 
setGeometry() because sizeHint() won't do anything? more genius, because it's 
pretty damn lame to say that applets only resize properly in a layout.

i suppose we could really screw with things and in sizeHint() ask if 
parent()->layout() exists and if not make a call to setGeometry() too. *sigh*

copying more from QWidget and having a resize() doesn't help much either 
because of the need for external constraints ... again.

and that's the entire reason why i didn't want to go this route in the first 
place because unlike regular Qt widgets applets and other canvas widgets are 
naturally *constrained in size* by external geometries (e.g. panels)

but eventually i just gave up discussing and said "go for it" ... the code 
would or wouldn't work and it's easier and faster to just let it go into svn 
and fix it from there. every wonder why so many FOSS projects become 
benevolent dictatorships?

yeah, i'm bitter right now. i'll be better tomorrow.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20070901/902109f6/attachment.pgp 


More information about the Panel-devel mailing list