[Panel-devel] Panel contentSize
Sébastien Le Ray
beuss at tuxfamily.org
Mon Nov 26 13:35:17 CET 2007
Le Mon, 26 Nov 2007 12:36:20 +0100,
Sebastian Kügler <sebas at kde.org> a écrit :
> On Monday 26 November 2007 12:32:30 Sébastien Le Ray wrote:
> > Trying to fit an applet to the inner size of the panel (to avoid the
> > hardcoded 48 value everywhere)... Should I use the layout margins ?
>
> contentSize() returns a height of 48 in the panel, no? The width
> needs to be set accordingly, but I'd wait fixing that until the panel
> layout has the necessary features -- i.e. is able to do something
> sensible with contentSizeHint() from the applet.
Returned height seems to be more than 48, it also includes margins
of the background. If we take the standard panel (bottomEdge), looking
at the code we see that an height is set (to 48) and then we add the
background margin to this (height += topHeight - 1). So the height used
in geometry is the height were applets are displayed plus the top
margin of the background which leads to a situation where contentSize
gives us an height of 70 (with a panel of 48) so applets (or other
clients) calling contentSize believe that they can draw on 70 pixels,
but, the actual displayed size will be 48 since applet is positionned
below background margins.
---------------------------------------------------------------
^ | ----------------------------------------------------------- |
| ^ | | | |
|70 |48 | | | |
With the above configuration (on a 1024x768 screen) we get a contentSize
of 1024 x 70 whereas it should be 984x48 since elements are actually
displayed on an area from which margins are excluded...
Dis I miss something ? (if I'm not clear, don't hesitate to ask)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20071126/a7350508/attachment.pgp
More information about the Panel-devel
mailing list