Hi,
I’m struggling with a layout problem:
I have a view (a status bar, basically), which contains other views/controls.
These views can resize themselves for various reasons (because the labels change, for example)
I’d like views to keep their absolute position: the view in the center should stay centered relative to the parent view.
I tried using a BGroupLayout and a BGroupLayout, but it seems I can’t get it correctly.
I don’t think one of the basic layout types can do that.
If your center view drawing code is simple enough, you may draw it directly from the parent view’s Draw function instead of having a child view, and compute the centering yourself in your drawing code.
Otherwise, the ALM layout should be able to do it if you are able to figure it out. Sadly it is very under-used, but “in the center of the parent view” seems like it can be expressed in an ALM linar constraint.
I guess we should explore it a bit more and document its usage with a few examples.
As far as I know, yes, you just set a BALMLayout for one view and fill it.
There are no equivalent to BGridView/BGroupView and it’s not integrated in the new template based BLayoutBuilder. There is only an “old style” BALMLayoutBuilder. It looks like in addition to not having examples, we didn’t quite finish integrating it in libbe and interface kit.
Trying to see if I can use ALM, but it seems the headers include LinearSpec.h which cannot be found anywhere.
I guess it’s part of linprog but can’t find anything related on Haiku depot.
Any idea ?
ALM is partially integrated into the Haiku source tree. I submitted a bug report about this a while back that was fixed. The headers should be available in nightly builds, but not beta5.