summaryrefslogtreecommitdiffstats
path: root/examples/tour/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-08-26 20:04:02 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-08-26 20:04:02 +0200
commita07cb8588f1ae73b36c181ba200452f863366d11 (patch)
tree1e0697dbb11d391b8448df7db95f285d26959c93 /examples/tour/src
parentda7e8598406fcde2a33ea749d561a2f10dbb5407 (diff)
downloadiced-a07cb8588f1ae73b36c181ba200452f863366d11.tar.gz
iced-a07cb8588f1ae73b36c181ba200452f863366d11.tar.bz2
iced-a07cb8588f1ae73b36c181ba200452f863366d11.zip
Reintroduce `Element::explain`
Diffstat (limited to 'examples/tour/src')
-rw-r--r--examples/tour/src/main.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/examples/tour/src/main.rs b/examples/tour/src/main.rs
index 82dac0cd..378508e1 100644
--- a/examples/tour/src/main.rs
+++ b/examples/tour/src/main.rs
@@ -69,16 +69,24 @@ impl Sandbox for Tour {
);
}
- let content = column![
+ let content: Element<_> = column![
steps.view(self.debug).map(Message::StepMessage),
controls,
]
.max_width(540)
.spacing(20)
- .padding(20);
+ .padding(20)
+ .into();
- let scrollable =
- scrollable(container(content).width(Length::Fill).center_x());
+ let scrollable = scrollable(
+ container(if self.debug {
+ content.explain(Color::BLACK)
+ } else {
+ content
+ })
+ .width(Length::Fill)
+ .center_x(),
+ );
container(scrollable).height(Length::Fill).center_y().into()
}