Make Widget::diff mutable
This commit is contained in:
parent
31bc6d48cd
commit
497ebcd0c3
31 changed files with 114 additions and 81 deletions
|
|
@ -91,13 +91,13 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
pub(super) fn diff(&self, tree: &mut Tree) {
|
||||
pub(super) fn diff(&mut self, tree: &mut Tree) {
|
||||
if tree.children.len() == 2 {
|
||||
if let Some(title_bar) = self.title_bar.as_ref() {
|
||||
if let Some(title_bar) = self.title_bar.as_mut() {
|
||||
title_bar.diff(&mut tree.children[1]);
|
||||
}
|
||||
|
||||
tree.children[0].diff(&self.body);
|
||||
tree.children[0].diff(&mut self.body);
|
||||
} else {
|
||||
*tree = self.state();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,17 +128,17 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
pub(super) fn diff(&self, tree: &mut Tree) {
|
||||
pub(super) fn diff(&mut self, tree: &mut Tree) {
|
||||
if tree.children.len() == 3 {
|
||||
if let Some(controls) = self.controls.as_ref() {
|
||||
if let Some(compact) = controls.compact.as_ref() {
|
||||
if let Some(controls) = self.controls.as_mut() {
|
||||
if let Some(compact) = controls.compact.as_mut() {
|
||||
tree.children[2].diff(compact);
|
||||
}
|
||||
|
||||
tree.children[1].diff(&controls.full);
|
||||
tree.children[1].diff(&mut controls.full);
|
||||
}
|
||||
|
||||
tree.children[0].diff(&self.content);
|
||||
tree.children[0].diff(&mut self.content);
|
||||
} else {
|
||||
*tree = self.state();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue