[Panel-devel] [PATCH] Beginnings of a panel implementation for discussion

Matt Broadstone mbroadst at gmail.com
Thu Aug 23 19:45:40 CEST 2007


On 8/23/07, Percy Leonhardt <mailings at eris23.de> wrote:
> On Monday 20 August 2007, Robert Knight wrote:
> > As an aside, HBoxLayout and VBoxLayout are very similar internally.  I
> > think it would be a good idea to try and merge them to avoid bugs
> > arising from duplication.
>
> Talking about bugs in layout, is it okay to commit the following?
>
> --- hboxlayout.cpp      (revision 703347)
> +++ hboxlayout.cpp      (working copy)
> @@ -75,7 +75,7 @@
>
>      foreach (LayoutItem *l, fixedChildren) {
>          QSizeF hint = l->sizeHint();
> -        sizes.insert(indexOf(l), QSizeF(available.width(), hint.height()));
> +        sizes.insert(indexOf(l), QSizeF(hint.width(), available.height()));
>          available -= QSizeF(hint.width() + spacing(), 0.0f);
>      }
>
> @@ -113,6 +113,8 @@
>          hintHeight = qMax(hint.height(), hintHeight);
>          hintWidth += hint.width() + spacing();
>      }
> +    hintWidth += 2 * margin();
> +    hintHeight += 2 * margin();
>
>      return QSizeF(hintWidth, hintHeight);
>  }
>
>
> --- vboxlayout.cpp      (revision 703347)
> +++ vboxlayout.cpp      (working copy)
> @@ -118,6 +118,8 @@
>          hintWidth = qMax(hint.width(), hintWidth);
>          hintHeight += hint.height() + spacing();
>      }
> +    hintWidth += 2 * margin();
> +    hintHeight += 2 * margin();
>
>      return QSizeF(hintWidth, hintHeight);
>  }
>
>
Looks good to me, but while you're at it get rid of that code dupe and
move it into BoxLayout.

Matt

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


More information about the Panel-devel mailing list