summaryrefslogtreecommitdiffstats
path: root/widget/src/pane_grid/node.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2023-07-06 08:40:05 +0200
committerLibravatar GitHub <noreply@github.com>2023-07-06 08:40:05 +0200
commitfb512c3b70fbec6cc63298626d714ef818560519 (patch)
treef216d551a975d05c836d686f3a71c27805b9ab38 /widget/src/pane_grid/node.rs
parent7f805bc5dd9ed38c904d83f9ea931eed6f3234bf (diff)
parent0964f12db7002f535f8eeda1791ea8962be6e71a (diff)
downloadiced-fb512c3b70fbec6cc63298626d714ef818560519.tar.gz
iced-fb512c3b70fbec6cc63298626d714ef818560519.tar.bz2
iced-fb512c3b70fbec6cc63298626d714ef818560519.zip
Merge pull request #1865 from jhff/pane_grid_edge_with_dragged_pane
[Feature] Pane Grid: drag & drop panes to the edges
Diffstat (limited to 'widget/src/pane_grid/node.rs')
-rw-r--r--widget/src/pane_grid/node.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/widget/src/pane_grid/node.rs b/widget/src/pane_grid/node.rs
index 3976acd8..6de5920f 100644
--- a/widget/src/pane_grid/node.rs
+++ b/widget/src/pane_grid/node.rs
@@ -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);