Repository navigation
Add a dock tree data model to bevy_ui_widgets - #26034
jbuehler23 wants to merge 3 commits into
Conversation
|
Why a distinct crate rather than a module in We can always feature flag this too to reduce compile times etc if it ever matters. |
72772ae to
5fa099d
Compare
|
Fair, moved it into |
viridia
left a comment
There was a problem hiding this comment.
Very interesting. Just some preliminary questions at this point.
| @@ -0,0 +1,44 @@ | |||
| //! Dock layouts for Bevy UI, described as plain data. | |||
There was a problem hiding this comment.
Is this meant to be a representational source of truth, or a wire format derived from the scene?
Reading further down, I see that it is a component. What entity owns it?
I'm a little fuzzy on the lifecycle - if this is derived from the scene, it makes sense, since extracting this would make it easier to serialize. If OTOH the scene is derived from this, I'm not as clear why the scene isn't the source of truth (I'm sure there's a reason, I just don't know it yet.)
Objective
Part of #25958.
Dockable panel layouts need a model of which panels sit in which tab groups and how the space is split, separate from the UI that shows them, so layouts can be edited, saved and restored.
Solution
A
dockmodule inbevy_ui_widgetswith the dock tree as plain data. Leaves are tab groups and splits hold weighted children, with weights that match the split pane so the next PR can turn the tree straight into split panes and tab lists.DockTreecomponent, so an app can have more than one dockDockPanelKeythe app maps to what it buildssimplifyremoves empty groups and collapses single child splitsserializefeatureThere's no UI here yet, building it from the tree comes next.
AI disclosure
This is ported from the dock tree in Jackdaw. I had AI move it into
bevy_ui_widgets, strip the editor specific parts and change splits to weighted children so they line up with the split pane, then port and extend the tests. I reviewed the model and the changes from the original.