Re: Extended Layout Summary
- From: "Matthias Clasen" <matthias clasen gmail com>
- To: "Behdad Esfahbod" <behdad behdad org>
- Cc: Gtk+ Developers <gtk-devel-list gnome org>
- Subject: Re: Extended Layout Summary
- Date: Wed, 21 Nov 2007 22:10:26 -0500
On Nov 21, 2007 3:04 PM, Behdad Esfahbod <behdad behdad org> wrote:
> On Nov 20, 2007 10:07 PM, Matthias Clasen <matthias clasen gmail com> wrote:
> > On Nov 20, 2007 8:45 PM, Behdad Esfahbod <behdad behdad org> wrote:
> >
> > > a) Maximize number of children taking their natural size.
> >
> > I am not convinced this is always the best strategy. Doesn't this
> > encourage starving
> > one child in favour of the rest of the pack getting their natural size?
>
> Right. We can add another goal to avoid starvation:
>
> c) If child i takes its natural size and child j doesn't, child j
> should have received at least as much gap as child i.
>
> The algorithm I sketched satisfies this too.
Yeah, true.
Alternatively: there shall not be both children who receive less than
their natural width and children that receive more than their natural
width.
Anyway, I don't think that the example of "bunch of ellipsiizing
labels" can be generalized to make the
case that the hippo-style algorithm is always better than some linear
distribution scheme.
One thing that I have not seen mentioned in this discussion so far is
the fact that it is ultimatively an implementation detail of the
container how it distributes its allocation to its children. There is
nothing
prohibiting a linearly-distributing container and a hippo-style
container from coexisting. Both can use
the same extended layout interface. It would also be possible to make
the distribution algorithm
pluggable.
Matthias
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]