Closed matthunz closed 4 months ago
Option<Box<dyn Widget>>
is probably the easiest way to start. But we might want to think about adding a custom enum for "special" data associated with nodes (which would includes masonry widgets, but mights also image data for <img>
(perhaps separate for raster vs. SVG), text input data for <input>
, table layout context for <table>
, inline layout context for inline roots, etc. We'd probably still want to Box the content of each variant.
Motivation being to avoid bloating node size with a bunch of Option<Box<_>>
(even if they're only 64bits each). I can't think of any nodes that require multiple of these yet.
For text input we can wrap around Masonry's
TextBox
.My current idea is rather than use a separate widget tree for Masonry elements, we can have
Option<Box<dyn Widget>>
or similar in Blitz'sNode
struct.We may want to implement the focus stack first https://github.com/DioxusLabs/blitz/issues/92