Make Widget::layout and operate mutable

... and bless `responsive`!
This commit is contained in:
Héctor Ramón Jiménez 2025-08-20 22:42:15 +02:00
parent 9490d735c5
commit 31bc6d48cd
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
54 changed files with 284 additions and 519 deletions

View file

@ -259,7 +259,7 @@ where
}
fn layout(
&self,
&mut self,
tree: &mut Tree,
renderer: &Renderer,
limits: &layout::Limits,
@ -273,12 +273,14 @@ where
self.padding,
self.horizontal_alignment,
self.vertical_alignment,
|limits| self.content.as_widget().layout(tree, renderer, limits),
|limits| {
self.content.as_widget_mut().layout(tree, renderer, limits)
},
)
}
fn operate(
&self,
&mut self,
tree: &mut Tree,
layout: Layout<'_>,
renderer: &Renderer,
@ -288,7 +290,7 @@ where
self.id.as_ref().map(|id| &id.0),
layout.bounds(),
&mut |operation| {
self.content.as_widget().operate(
self.content.as_widget_mut().operate(
tree,
layout.children().next().unwrap(),
renderer,