1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-27 07:03:14 -04:00

Refactor: use a single struct Branch

This commit is contained in:
Emil Ernerfeldt
2023-04-25 13:19:24 +02:00
parent 4be5f43a3a
commit ea47d36de7
2 changed files with 208 additions and 214 deletions

View File

@@ -177,18 +177,8 @@ fn tree_ui(
.default_open(true)
.show(ui, |ui| match node {
dock::Node::Leaf(_) => {}
dock::Node::Tabs(tabs) => {
for &child in &tabs.children {
tree_ui(ui, behavior, nodes, child);
}
}
dock::Node::Horizontal(layout) => {
for &child in &layout.children {
tree_ui(ui, behavior, nodes, child);
}
}
dock::Node::Vertical(layout) => {
for &child in &layout.children {
dock::Node::Branch(branch) => {
for &child in &branch.children {
tree_ui(ui, behavior, nodes, child);
}
}