From 2d69f53b3812563141c132f689ae39a3dd682c11 Mon Sep 17 00:00:00 2001 From: zkldi Date: Sun, 2 Jul 2023 00:00:08 +0100 Subject: [PATCH] feat: double click on separator to reset size (#146) * Update egui version in badge * fix: typo * feat: double click to reset resizing --------- Co-authored-by: Adanos020 --- src/widgets/dock_area/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/widgets/dock_area/mod.rs b/src/widgets/dock_area/mod.rs index 1a462a7..938cadd 100644 --- a/src/widgets/dock_area/mod.rs +++ b/src/widgets/dock_area/mod.rs @@ -190,7 +190,7 @@ impl<'tree, Tab> DockArea<'tree, Tab> { } } - // Finaly draw separators so that their "interaction zone" is above + // Finally draw separators so that their "interaction zone" is above // bodies (see `SeparatorStyle::extra_interact_width`). for node_index in self.tree.breadth_first_index_iter() { if self.tree[node_index].is_parent() { @@ -350,6 +350,10 @@ impl<'tree, Tab> DockArea<'tree, Tab> { *fraction = (*fraction + delta / range).clamp(min, max); } } + + if response.double_clicked() { + *fraction = 0.5; + } } } }