Merge branch 'main' into allow-following-outside-of-projects
This commit is contained in:
commit
a8b35eb8f5
147 changed files with 5383 additions and 1726 deletions
|
@ -84,6 +84,13 @@ impl PaneGroup {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn swap(&mut self, from: &ViewHandle<Pane>, to: &ViewHandle<Pane>) {
|
||||
match &mut self.root {
|
||||
Member::Pane(_) => {}
|
||||
Member::Axis(axis) => axis.swap(from, to),
|
||||
};
|
||||
}
|
||||
|
||||
pub(crate) fn render(
|
||||
&self,
|
||||
project: &ModelHandle<Project>,
|
||||
|
@ -421,6 +428,21 @@ impl PaneAxis {
|
|||
}
|
||||
}
|
||||
|
||||
fn swap(&mut self, from: &ViewHandle<Pane>, to: &ViewHandle<Pane>) {
|
||||
for member in self.members.iter_mut() {
|
||||
match member {
|
||||
Member::Axis(axis) => axis.swap(from, to),
|
||||
Member::Pane(pane) => {
|
||||
if pane == from {
|
||||
*member = Member::Pane(to.clone());
|
||||
} else if pane == to {
|
||||
*member = Member::Pane(from.clone())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn bounding_box_for_pane(&self, pane: &ViewHandle<Pane>) -> Option<RectF> {
|
||||
debug_assert!(self.members.len() == self.bounding_boxes.borrow().len());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue