[haiku-3rdparty-dev] Re: Layouting question

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Tue, 26 Apr 2016 14:03:12 -0700

On Tue, Apr 26, 2016 at 9:18 AM, Humdinger <dmarc-noreply@xxxxxxxxxxxxx> wrote:

I want the icon to stick to the left border and the text+buttons to
stick to the icon. The BTextView is supposed to grow to the right, if
the window is resized horizontally.

Currently with this code:
https://github.com/humdingerb/Filer/blob/newgui/sources/Filer/HelpTab.cpp#L150
the views don't stick as they should. Do I need some .AddGlue()
somewhere or have some of the view put on some "weight"? I tried and
tried, but didn't succeed.

If you AddGlue() between your two vertical groups it will push them
left and right respectively, but that's probably not what you want.
You want the left vertical group to stay put and the right vertical
group to grow.

I see that you have overridden MinSize() and MaxSize() of IconView to
64x64. That should keep it from growing

I've never had any success using the SetWeight functions on
GroupViews. I suspect the weights are currently ignored.

Is the fInfo text view not growing when you resize?

You could try putting the BTextView inside a BScrollView and see if
that works better for you.

Remove the last AddGlue() in your horizontal group to make the buttons
flush right.

Also, there seems to be something wrong with the BTextView fInfo. With
it added to the BHelpTab view, I can vertically resize the window to
cut off the buttons below and a part of the BTextView:
https://lut.im/loe358An12/3e7wMzpzDTuDceND.png

Why is that?

That is expected. Set the minimum height on the window to prevent that
from happening.

Other related posts: