Skip to content

Track sizing support in Grid widget and view#1794

Open
RagibHasin wants to merge 8 commits into
linebender:mainfrom
RagibHasin:greedy
Open

Track sizing support in Grid widget and view#1794
RagibHasin wants to merge 8 commits into
linebender:mainfrom
RagibHasin:greedy

Conversation

@RagibHasin
Copy link
Copy Markdown
Contributor

This completely reworks how the Grid widget lays its children out.

The new implementation closely follows CSS grid specification with one intentional deviation, it does not support minmax track size. It has been omitted from track sizing MVP and because I don't find it very useful.

@RagibHasin RagibHasin force-pushed the greedy branch 2 times, most recently from 7fd925e to 62cc580 Compare May 13, 2026 16:36
@RagibHasin RagibHasin marked this pull request as ready for review May 13, 2026 16:36
@RagibHasin RagibHasin requested review from PoignardAzur and xStrom and removed request for xStrom May 13, 2026 16:38
@RagibHasin RagibHasin force-pushed the greedy branch 2 times, most recently from f42ed69 to 3bc58b7 Compare May 13, 2026 17:40
@PoignardAzur
Copy link
Copy Markdown
Contributor

Thanks for the work! Not sure I'll have time to review it in the coming weeks, but I definitely appreciate changes that get us closer to CSS Grid behavior.

At first glance, my impression is that this PR makes a lot of drive-by changes to the API, some of which I don't agree with. For instance, I don't see a reason to remove GridExt::grid_pos, and I think replacing GridParams::new with tuples makes the code harder to read.

Anyway, I'll do a more in-depth review soon. This is work we really want to get merged!

@RagibHasin
Copy link
Copy Markdown
Contributor Author

I don't see a reason to remove GridExt::grid_pos

I removed that and unified its functionality into GridExt::grid to be similar to FlexExt::flex. Also, GridParams implements From<(u16, u16)> for position items, making grid_pos more verbose.

I think replacing GridParams::new with tuples makes the code harder to read.

I would replace the tuples with GridParams builder methods if requested. GridParams::new() is now a default constructor as it should be, IMO.

@RagibHasin RagibHasin force-pushed the greedy branch 2 times, most recently from 1e27c91 to f672300 Compare May 20, 2026 03:11
@PoignardAzur
Copy link
Copy Markdown
Contributor

(I'm back from RustWeek, will probably review this tomorrow!)

@PoignardAzur PoignardAzur self-assigned this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants