summaryrefslogtreecommitdiffstats
path: root/examples/toast
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-08-30 04:31:21 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-08-30 04:31:21 +0200
commited3454301e663a7cb7d73cd56b57b188f4d14a2f (patch)
tree8118d1305c2eba3a1b45d04634cd0e8d050fc0fa /examples/toast
parentc9bd48704dd9679c033dd0b8588e2744a3df44a0 (diff)
downloadiced-ed3454301e663a7cb7d73cd56b57b188f4d14a2f.tar.gz
iced-ed3454301e663a7cb7d73cd56b57b188f4d14a2f.tar.bz2
iced-ed3454301e663a7cb7d73cd56b57b188f4d14a2f.zip
Implement explicit text caching in the widget state tree
Diffstat (limited to 'examples/toast')
-rw-r--r--examples/toast/src/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/toast/src/main.rs b/examples/toast/src/main.rs
index 42f6c348..01eea3cc 100644
--- a/examples/toast/src/main.rs
+++ b/examples/toast/src/main.rs
@@ -326,10 +326,13 @@ mod toast {
fn layout(
&self,
+ tree: &Tree,
renderer: &Renderer,
limits: &layout::Limits,
) -> layout::Node {
- self.content.as_widget().layout(renderer, limits)
+ self.content
+ .as_widget()
+ .layout(&tree.children[0], renderer, limits)
}
fn tag(&self) -> widget::tree::Tag {
@@ -517,6 +520,7 @@ mod toast {
10.0,
Alignment::End,
self.toasts,
+ self.state,
)
.translate(Vector::new(position.x, position.y))
}