summaryrefslogtreecommitdiffstats
path: root/examples/toast
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2023-09-10 01:14:39 +0200
committerLibravatar GitHub <noreply@github.com>2023-09-10 01:14:39 +0200
commit1af5ff41abdef243588199ef7988666655924a02 (patch)
tree4dfd518dd93b0393e77355867062c60d75e7f358 /examples/toast
parenta3489e4af960388e9f73988b88df361022a654a4 (diff)
parent1cc5bf59d7c4f47ae47d9a4e22ebaab3ea4975c1 (diff)
downloadiced-1af5ff41abdef243588199ef7988666655924a02.tar.gz
iced-1af5ff41abdef243588199ef7988666655924a02.tar.bz2
iced-1af5ff41abdef243588199ef7988666655924a02.zip
Merge pull request #2058 from iced-rs/explicit-text-caching
Explicit text caching
Diffstat (limited to 'examples/toast')
-rw-r--r--examples/toast/src/main.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/toast/src/main.rs b/examples/toast/src/main.rs
index 47b272a9..8570a38e 100644
--- a/examples/toast/src/main.rs
+++ b/examples/toast/src/main.rs
@@ -328,10 +328,15 @@ mod toast {
fn layout(
&self,
+ tree: &mut Tree,
renderer: &Renderer,
limits: &layout::Limits,
) -> layout::Node {
- self.content.as_widget().layout(renderer, limits)
+ self.content.as_widget().layout(
+ &mut tree.children[0],
+ renderer,
+ limits,
+ )
}
fn tag(&self) -> widget::tree::Tag {
@@ -502,7 +507,7 @@ mod toast {
for Overlay<'a, 'b, Message>
{
fn layout(
- &self,
+ &mut self,
renderer: &Renderer,
bounds: Size,
position: Point,
@@ -519,6 +524,7 @@ mod toast {
10.0,
Alignment::End,
self.toasts,
+ self.state,
)
.translate(Vector::new(position.x, position.y))
}