From 480f935319e6d02dd36606c7cf315f3ff9face2a Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 1 Sep 2022 22:51:30 +0200 Subject: [PATCH] Remove example from README.md Better to just have the one in the docs, which is tested --- README.md | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/README.md b/README.md index 4e3804f..9362311 100644 --- a/README.md +++ b/README.md @@ -12,39 +12,6 @@ This fork aims to provide documentation and further development if necessary. ![demo](images/demo.gif "Demo") -## Usage - -First, construct the initial tree: - -```rust -use egui::{Color32, RichText, style::Margin}; -use egui_dock::{TabBuilder, Tree, NodeIndex}; - -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]); - -tree.split_left(NodeIndex::root(), 0.20, vec![tab2]); -``` - -Then, you can show the dock. - -```rust -DockArea::new(&mut tree).show(ctx); -``` - ## Contribution Feel free to open issues and pull requests.