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

  • From: "Humdinger" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "humdingerb" for DMARC)
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Thu, 5 May 2016 12:36:12 +0200

Hi there!

To bring closure to this thread... :)
I managed to overcome all my layouting issues with a little direction
from Rene, who saved me from misunderstanding what's to be done with
GetHeightForWidth(). I also did SetExplicitMaxSize() on all those
BStringViews. If anyone wants to take a peek: [1]

On 28 April 2016 at 11:29, Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:

On 04/26/2016 06:18 PM, Humdinger (Redacted sender humdingerb for DMARC)
wrote:
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

You have to set the window flag B_AUTO_UPDATE_SIZE_LIMITS for the size
constraints computed by the layout system to be enforced on the window.

For the record, I did have that flag set.

There's a catch in your case, though: You have enabled word wrapping on you
BTextView, so the view becomes a height-for-width view, meaning that its
min/max height constraints depend on its actual width (narrower text
requires more height, wider text less height). The layout system itself
supports this concept (via HasHeightForWidth()/GetHeightForWidth()), the app
server, however, does not. Since the view is not embedded in any parent that
eliminates the effects, the property is propagated up to the root view of
the window and due to the missing support in the app server (or even BWindow
API to notify it), only the constraints ignoring the height-for-width
properties will be enforced on the window. Those are laxer, so it will be
possible to resize the windows smaller or greater than it actually needs to
be.

Who may I bribe to add the mentioned missing support to the app_server / API? :)
And can anything be done against having to use
SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED)) on every
widget in a view? It's very possible that I'm doing something wrong,
but if I don't, the resizing doesn't work as planned...

Regards,
Humdinger

[1] https://github.com/HaikuArchives/Filer/blob/master/sources/HelpTab.cpp#L143

--
Did you know:
  If half the Haiku supporters at http://www.goodsearch.com
  made 10 searches a day, we could have a fulltime developer.

Other related posts: