fjvallarino/monomer

Wrapping/Floating Grids

Opened this issue · 1 comments

As I currently understand it, there's no (easy) way to allow widgets to float from one row of a grid to another. I'm working on a widget that is essentially a large grid of buttons, and I'd like the number of widgets per row to be dependent on the size allotted to the grid.

e.g. if the grid is currently 10x5 buttons, and then is resized to only have half the horizontal space, then it would become a 5x10 grid of buttons.

For an example of the kind of grid I'm looking for, got to jisho.org and click on "Radicals". Then, try resizing the browser window.

@Anteproperispomenon there is currently not a layout widget like that, but it's something I have planned for the not-so-distant future. The way I envision it, it should support these behaviors:

  • You should be able to specify a minimum/maximum width per item, have them adjust their size as needed, and flow to the next row when appropriate.
  • Alternatively, it should support specifying a maximum number of items per row.
  • Fixed width items should not be affected by resizing mechanisms.
  • The height of a row is determined by the tallest widget contained in it. Vertical alignment should be handled by the user (with box, for example).
  • These behaviors, which I described flowing horizontally, should also be supported vertically. Not simultaneously; it's one or the other.

There are some extra complications, such as the sizing requests of each widget. Handling the fixed case and proportional ones is not a problem, but it becomes more complex with all the other cases. At the same time, maybe those two cases are enough.