Make Widget::layout and operate mutable
... and bless `responsive`!
This commit is contained in:
parent
9490d735c5
commit
31bc6d48cd
54 changed files with 284 additions and 519 deletions
|
|
@ -299,15 +299,15 @@ where
|
|||
}
|
||||
|
||||
fn layout(
|
||||
&self,
|
||||
&mut self,
|
||||
tree: &mut Tree,
|
||||
renderer: &Renderer,
|
||||
limits: &layout::Limits,
|
||||
) -> layout::Node {
|
||||
let t = tree.state.downcast_mut::<Rc<RefCell<Option<Tree>>>>();
|
||||
|
||||
self.with_element(|element| {
|
||||
element.as_widget().layout(
|
||||
self.with_element_mut(|element| {
|
||||
element.as_widget_mut().layout(
|
||||
&mut t.borrow_mut().as_mut().unwrap().children[0],
|
||||
renderer,
|
||||
limits,
|
||||
|
|
@ -378,7 +378,7 @@ where
|
|||
}
|
||||
|
||||
fn operate(
|
||||
&self,
|
||||
&mut self,
|
||||
tree: &mut Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &Renderer,
|
||||
|
|
@ -387,8 +387,8 @@ where
|
|||
self.rebuild_element_with_operation(layout, operation);
|
||||
|
||||
let tree = tree.state.downcast_mut::<Rc<RefCell<Option<Tree>>>>();
|
||||
self.with_element(|element| {
|
||||
element.as_widget().operate(
|
||||
self.with_element_mut(|element| {
|
||||
element.as_widget_mut().operate(
|
||||
&mut tree.borrow_mut().as_mut().unwrap().children[0],
|
||||
layout,
|
||||
renderer,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue