[Panel-devel] [PATCH] Layout Code Update

Leo Franchi lfranchi at gmail.com
Thu Aug 16 19:53:03 CEST 2007


On 8/16/07, Percy Leonhardt <mailings at eris23.de> wrote:
>
> On Wednesday 15 August 2007, Leo Franchi wrote:
> > i'm achieving a gridlayout-like thing by combining a HBoxLayout with
> > multiplel VBoxLayout children. it works pretty well overall :)
>
> This seems to be a copy&paste bug:
>
> Index: hboxlayout.cpp
> ===================================================================
> --- hboxlayout.cpp (revision 700011)
> +++ hboxlayout.cpp (working copy)
> @@ -81,7 +81,7 @@
>
>   qreal expandWidth = 0;
>   if (expandingChildren.count() > 0) {
> - expandWidth = (available.height() - ((expandingChildren.count()
> - 1) * spacing())) / e
> xpandingChildren.count();
> + expandWidth = (available.width() - ((expandingChildren.count()
> - 1) * spacing())) / ex
> pandingChildren.count();
>   }
>
>   foreach (LayoutItem *l, expandingChildren) {
>
> Without this change HBoxLayout won't work for me. Ok to commit?
>
> And still I cannot get the layout working for a grid of labels. If I do
> not
> set the text of the labels directly when creating the layout there is not
> enough room allocated for the labels afterwards.
>
> Could you show me some example (or real) code with a working gridlayout?



Sure. I'm not actually working on a Plasma applet. I'm the guy integrating
libplasma into Amarok 2.0, so my layout is actually the layout  manager for
the whole contextview (plasma-like area).

since we have slightly different needs from plasma, i actually extended
HBoxLayout with custom layouting code, but if you want to take a look, its
here:

http://websvn.kde.org/trunk/extragear/multimedia/amarok/src/context/ColumnApplet.h?view=markup
http://websvn.kde.org/trunk/extragear/multimedia/amarok/src/context/ColumnApplet.cpp?view=markup

best,
leo

Thanks and bye,
>
>         Percy
> _______________________________________________
> Panel-devel mailing list
> Panel-devel at kde.org
> https://mail.kde.org/mailman/listinfo/panel-devel
>



-- 
______________________________________________________
Leo Franchi                    angel666 at myrealbox.com
4305 Charlemagne Ct         lfranchi at gmail.com
Austin                                 cell: (650) 704 3680
TX, USA                              home: (650) 329 0125
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/panel-devel/attachments/20070816/ac10bab8/attachment.html 


More information about the Panel-devel mailing list