Skip to content

Commit

Permalink
feat: double click on separator to reset size (#146)
Browse files Browse the repository at this point in the history
* Update egui version in badge

* fix: typo

* feat: double click to reset resizing

---------

Co-authored-by: Adanos020 <adanos020@gmail.com>
  • Loading branch information
zkldi and Adanos020 committed Jul 1, 2023
1 parent 096a1f3 commit 2d69f53
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/widgets/dock_area/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -350,6 +350,10 @@ impl<'tree, Tab> DockArea<'tree, Tab> {
*fraction = (*fraction + delta / range).clamp(min, max);
}
}

if response.double_clicked() {
*fraction = 0.5;
}
}
}
}
Expand Down

0 comments on commit 2d69f53

Please sign in to comment.