[haiku-commits] Re: haiku: hrev48491 - src/preferences/filetypes

  • From: Adrien Destugues <pulkomandy@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 12 Dec 2014 19:32:46 +0100

On Fri, Dec 12, 2014 at 06:30:34PM +0100, Stephan Aßmus wrote:
> Hi,
> 
> Am 12.12.2014 16:12, schrieb pulkomandy@xxxxxxxxxxxxx:
> >hrev48491 adds 1 changeset to branch 'master'
> >old head: 27627e22dbccc61391c4e52e2c482fa1ee53c753
> >new head: f0eb9fcd9323903b2c1b7046a0a78e078663c6dc
> >overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=f0eb9fc+%5E27627e2
> >
> >----------------------------------------------------------------------------
> >
> >f0eb9fc: FileTypes: make space for BBox titles
> >
> >   In some locales the title is longer than the space there is for it. Make
> >   sure the boxes are wide enough for the title to display completely.
> 
> This "bug-fix" looks wrong in several ways. First of all you are "fixing"
> the same bug in three different places. That should always set off some
> alarm.

Yes, it would of course be better to fix this directly in BBox. But that
is more complex I think because the title can be any kind of view, not
just a text label.

The fix also isn't complete, as the box layout should be adjusted to
make space for the title vertically as well. Right now, it is truncated
vertically by the contents. But I don't know how to fix that.

> Second, you are replacing it with a different bug: If the contents of
> the boxes are bigger than the label, you have now told the box that it is in
> fact OK to be smaller than its contents! It should be obvious that the real
> fix should be in BBox, where it should choose the maximum of the content or
> label width for its minimum size.

I forgot how this explicit minimal size works. And our documentation
about it does not help, at all:
http://api.haiku-os.org/classBLayoutItem.html

From your comment I guess it overrides the computation of the size from
the lower levels (the contents is layouted itself and can have its own
size constraints, which I assumed would be properly composed by the
layout system to compute the correct size).

If the way sizing in the layout kit worked was documented, maybe I would
learn to use it properly. Otherwise the only things I can do is wait for
someone else to fix the bugs, or hack the code until it looks like it's
working.

-- 
Adrien.

Other related posts: