Add ability to drag pane to the pane grid edges & optional style for dragged pane
This commit is contained in:
parent
7f805bc5dd
commit
e5c9dd54b3
5 changed files with 293 additions and 106 deletions
|
|
@ -120,6 +120,16 @@ impl Node {
|
|||
};
|
||||
}
|
||||
|
||||
pub(crate) fn split_inverse(&mut self, id: Split, axis: Axis, pane: Pane) {
|
||||
*self = Node::Split {
|
||||
id,
|
||||
axis,
|
||||
ratio: 0.5,
|
||||
a: Box::new(Node::Pane(pane)),
|
||||
b: Box::new(self.clone()),
|
||||
};
|
||||
}
|
||||
|
||||
pub(crate) fn update(&mut self, f: &impl Fn(&mut Node)) {
|
||||
if let Node::Split { a, b, .. } = self {
|
||||
a.update(f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue