mirror of
https://github.com/encounter/egui_dock.git
synced 2026-07-10 03:18:37 -07:00
88af4885c868391d48b1356b52cb396af8672242
egui_dock: docking support for egui
Credit goes to @Iain-dono for implementing the actual library.
This fork aims to provide documentation and further development if necessary.
Demo
Usage
First, construct the initial tree:
use egui::{Color32, RichText, style::Margin};
use egui_dock::{TabBuilder, Tree, WithTitle};
let tab1 = TabBuilder::default()
.title(RichText::new("Tab 1").color(Color32::BLUE))
.content(|ui| {
ui.label("Tab 1");
})
.build();
let tab2 = TabBuilder::default()
.title("Tab 2")
.inner_margin(Margin::same(4.0))
.content(|ui| {
ui.label("Tab 2");
})
.build();
let mut tree = Tree::new(vec![tab1, tab2]);
Then, you can show the tree.
let style = egui_dock::Style::default();
let id = ui.id();
egui_dock::show(&mut ui, id, &style, &mut tree);
Contribution
Feel free to open issues and pull requests.
Languages
Rust
100%
