Been working on a grid layout similar to java's GridBagLayout, and (surprise surprise) it's totally non-trivial!
I'd like some help figuring out the best way to do it. The basic problem is:
Given a set of widgets with
- known min, max and preferred sizes,
- their desired (x, y) positions,
- the number of rows an columns each widget wants to take, and
- a fixed size to put everything in,
figure out the x positions of the beginning of each column, and the y positions of the beginning of each row.
This will allow us to set the bounding box of each widget.
Also important to be able to report a min, max and preferred size to the parent container, but first things first.
Right now uik/layouts.Grid will look at the widgets preferred size and (x, y) position (ignoring multiple col/row issues), and compact everything towards the top-left as much as possible while respecting the criteria.
I'm not sure of the best way to handle how much goes in each column or row when a widget spans multiples, or how to nicely give extra room in a col or row when the grid is larger than the "preferred" size.
Help?