[PATCH] panel placement at the center (or whatever) of the screen

Aaron J. Seigo aseigo at kde.org
Sun Apr 6 21:25:59 CEST 2008


On Saturday 05 April 2008, Marco Martin wrote:
> On Friday 04 April 2008, Aaron J. Seigo wrote:
> > On Friday 04 April 2008, Marco Martin wrote:
> > > uhm, what widget?
> >
> > the third parameter in Applet::paintInterface (and Widget::paintWidget,
> > QGraphicsItem::paint)
>
> hhm, contentsrect? it always has a 0,0 position, i ought it was the
> containment rect

ah .. right. hm. paintInterface doesn't have the widget. paintWidget does, 
however. blah! i remember why i did that too: to avoid people from using the 
widget and doing unplasma things in their widgets.

i'll add it to the Containment::StyleOption however (a ptr to the 
Plasma::View) and then it will work.

> > > anyways, using the geometry of the view(yeah, i know, bad) retrieved in
> > > paintinterface to calc the borders, the layout margins won't get
> > > updated,
> >
> > yes, it would require some caching of values (the widgets' geometry),
> > checking them in paintInterface and if they are different recalc the
> > margins.
>
> the problem is that if i call updateborders in paintinterface, or even do a
> layout()->setMargin() with an hardcoded value it seems to have no effect on
> the layout margins, until i manually resize the panel

the layout probably just needs to be invalidated. indeed, it doesn't do that 
in the set margins call. you can call invalidate() manually. i don't know how 
fixable that will be given that the margins are set in LayoutItem and the 
invalidation is in Layout. *shrug*

-- 
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: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080406/0809ffd4/attachment.pgp 


More information about the Panel-devel mailing list