[haiku-development] Re: BBox and layout

  • From: Clemens <clemens.zeidler@xxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 09 May 2012 16:01:40 +1200

On Wed, 09 May 2012 02:08:00 +1200, Alex Wilson <yourpalal2@xxxxxxxxx> wrote:


So again, I would change the default BBox semantic of SetLayout to add
a special BBoxLayout that has exactly one child which is the added
layout. This layout is placed exactly in the inner BBox frame. Guess in
99% thats what you want.
That's almost what I want, but I think playing with SetLayout like
that would be wrong. BView::SetLayout() should basically do the same
thing as BBox::SetLayout(). It's better, in my opinion, to default to
using a BBoxLayout when the view is built with the layout
constructors, or with the B_SUPPORTS_LAYOUT flag, and let the user
replace it if they want.

qt also gives a solution for this problem :-) They have a setContentsMargins in QWidget and QLayout and they using this setContentsMargins in BGroupBox to place the layout in the content area. So as you proposed earlier a SetInset in BLayout and consequently a SetInset in BView would do the trick :-)

Cheers,
        Clemens

Other related posts: