Amarok 2 containment positioning problems

Marco Martin notmart at gmail.com
Sun Nov 9 22:44:21 CET 2008


On Sunday 09 November 2008, Aaron J. Seigo wrote:
> On Sunday 09 November 2008, Mark Kretschmann wrote:
> > since bumping libplasma in Amarok recently we have been experiencing
> > problems with our containment layout. The problem becomes visible if
> > you zoom out of the containment: Instead of a grid of 2x2, Amarok now
> > shows all containments in one row, which hides some of the
> > containments due to lack of space.
>
> the naive and obvious patch is attached: it moves
> Containment::positionContainment to Corona::layoutContainments. it's BIC as
> it introduces a new virtua method, but it would allow you to override the
> layouting.
>
> what i don't like about the patch:
>
> * it's a new virtual method
>
> * it doesn't take panels into consideration (not important for amarok2, at
> least at this time)
>
> * it relies still on Containment calling the method at the right time ...
>
> so many ungood things.
>
> what i *think* we should probably do instead is get rid of all the
> positioning code in Containment and instead create a QGraphicsLayout (or
> similar class?) that handles this.

i think a gridlayout could be a good idea (but should still be a way to decide 
how many rows/columns)
i just wonder how would behave when there are say four containments of 
eterogeneus sizes in a grid, i kinda fear the result :/

> then if you wanted to customze the layout strategy, you just change the
> layout. in Corona::Corona we could do something like:
>
> if (!layout()) {
>     new DefaultCoronaLayout(this);
> }
>
> which would allow Corona subclasses the opportunity to register their own
> layout class in the subclass' constructor and avoid the overhead of
> DefaultCoronaLayout being unecessarily created.
>
> what would this layout class need to do?
>
> * handle off-screen widgets
> * handle panel containments
> * handle desktop (that name is just so bad now =) containments
> * adjust layout whenever a managed item changes size or position
>
> i don't think this is something for 4.2, though. it's great research work
> for 4.3, imho. in fact, in my 4.3 kjots book there's already an entry for
> this issue.
>
> in the meantime i'm fine with changing the default from 4 containments
> across to 2 containments across. i've even made that change in svn now. =)




More information about the Plasma-devel mailing list