swift-cross-ui
swift-cross-ui copied to clipboard
Layout system rewrite
I'll fill out this description once the PR is more complete. I'm just creating the PR now as a place to dump reminders for myself.
Todo
- [ ] Test Gtk 3 window sizing issues mentioned in huge comment in previous WindowGroupNode implementation
- [ ] Move all views and modifiers back after ensuring things work with the current limited set of views
- [ ] Look into ways to improve minimum window sizing behaviour (to match the previous implementation as much as possible). The SwiftUI way is not satisfactory in my opinion.
- [ ] Uncomment the hot reloading macro declarations
- [ ] Update benchmark test case visualiser to correctly set frame of app to requested size proposal
- [ ] Update roundSize implementation to print a warning when given an infinite size (once I've updated AppBackend's APIs such that we don't have any legitimate use for passing an infinite size to an integer-accepting backend method; e.g. the method to get the size of text makes sense to pass infinity to, but it should take a double vector not an integer one).
- [ ] Uncomment NSViewRepresentable implementation and fix it
- [ ] Update text to clip by default so that minimum window sizing at least seems sensible :) (that's what SwiftUI relies on)
- [ ] Avoid sorting stack children by flexibility when there's only one child.
- [ ] When asked for the maximum width of a vstack (or maximum height of a hstack) stop once a child has infinite width (or height for an hstack), to save computation.
- [ ] Detect 'simple' ScrollView size proposals such as 0x0 that don't require querying the child view.