Track sizing support in Grid widget and view#1794
Conversation
7fd925e to
62cc580
Compare
f42ed69 to
3bc58b7
Compare
|
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 Anyway, I'll do a more in-depth review soon. This is work we really want to get merged! |
I removed that and unified its functionality into
I would replace the tuples with |
1e27c91 to
f672300
Compare
|
(I'm back from RustWeek, will probably review this tomorrow!) |
PoignardAzur
left a comment
There was a problem hiding this comment.
Some general thoughts:
- I maintain that the
impl From<...>with tuples are a bad idea. They're way more error-prone than the builder methods, they're less IDE-friendly (IDEs can show you function argument names, but not for tuples), they're less explicit for someone reading the code, etc. Unless there's a very strong argument to have them (other than "it makes code shorter") I think I'll block the feature until they're removed, sorry. - I think you should keep the
Grid::with_dimensionsbuilder, since I expect it to be useful for a lot of examples. You could rename it and/or document that it creates tracks withGridTrackSize::FRACTION, or even pass the track size as a parameter. - Overall, I think it would be helpful to split this PR in two, one that deals with the renamed constructors, then one that deals with the logic changes. I won't block on it though.
Sorry to wait so long just to add more negative feedback. I still need to review the grid code itself, but I do think the ergonomics part is important on its own.
My rationale for this was similar impls for But I don't like the impending verbosity of the builder patterns, too. 🤷🏽 I think if we revert to
I have no opinion in this regard, so I would re-establish
That would be painful. I would like to skip splitting it. |
I think the compile times would be fine, but also I think that's over-engineering. In most cases I expect users to either specify both coordinates or nothing.
Fair enough. |
... and additional fallout [skip actions]
* Remove `impl From<tuples> for GridParams` * Reintroduce `GridExt::grid_pos` * Reintroduce `Grid::with_dimensions` * Rename `GridExt::grid` to `grid_params` * Fix import
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.