Thoughts on applet layouts

Alex Merry huntedhacker at tiscali.co.uk
Thu Mar 13 16:24:19 CET 2008


On Thursday 13 March 2008 13:21:14 Aaron J. Seigo wrote:
> On Thursday 13 March 2008, Alex Merry wrote:
> > Here's an idea I came up with for an applet layout system.  This comes
> > down
>
> a few quick questions so i can get a better understanding of you ideas:
>
> * is this meant to make it easier for Containment, Applets or both?

Applets, primarily.

>
> * how will this better / easier than a Containment supplying it's own
> Layout class? (other than obviously not having to create a separate
> subclass, i mean from the amount of code that needs to be written..)

Well, there's no reason the work couldn't be done by another class, rather
than the virtual layout() method.  As long as the class interface allows
grid layout of icons but not other applets, for example.

That wasn't the main point, TBH.

>
> * do you think that the QGraphicsWidget system of sizeHints would be enough
> for the widget side of things?

From QGraphicsLayoutItem?  Yes, that seems to provide the things I was
thinking of (setPreferredSize and setMinimumSize).  It then becomes a
policy thing - all applets need to do is call the relevant methods in
constraintsUpdated() (not updateConstraints as i kept saying in the last
email).

We would also need some API for getting the fixed width/height.  That could be 
done with just calling preferredSize or whatever

Although there's still the issue of borders then - presumably, the
QGraphicsLayoutItem API would deal with the size including the borders, which
the applet subclass wouldn't care about.  This doesn't matter on the panel,
but would for a grid layout on the desktop, for example.

Alex


-- 
KDE: http://www.kde.org
Ubuntu/Kubuntu: http://www.ubuntu.org http://www.kubuntu.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080313/be3f99e7/attachment.pgp 


More information about the Panel-devel mailing list