Shirakumo / alloy

A new user interface protocol and toolkit implementation
https://shirakumo.github.io/alloy
zlib License
181 stars 12 forks source link

Joining cells in grid-layout (feature request) #15

Closed Trashtalk217 closed 4 months ago

Trashtalk217 commented 4 years ago

I've been playing around with the grid-layout to try and make a calculator and I've ran into something the toolkit is missing. I'd like to have a layout-element spanning multiple cells. I've been trying to think this through and I've been reading the grid-layout code, but I don't see a simple solution. My first idea was to have the array that stores the layout-elements be allowed to have copies which are deconstructed later into full elements. I'm wording this badly, but an example will show it better:

[ A, A, A, A
  B, C, D, E,
  F, F, G, H,
  F, F, I, J ]

But it seems that I can only have a layout-element once in the grid-layout, so this isn't going to fly.

I want to add this feature myself, but I would like some pointers on how to approach this problem. Any help would be appreciated.

Shinmera commented 4 years ago

This is called a grid bag layout and is mentioned in the TODO file.

I don't have any ideas on good ways to make this kind of layout happen right now.

In the meantime you should be able to relate more complex relationships like that through the cassowary constraint-layout. It'll be a bit more verbose to set up, but it is definitely possible to express what you want using it.

Trashtalk217 commented 4 years ago

16

Shinmera commented 4 months ago

A grid-bag-layout has been implemented by @scymtym