summaryrefslogtreecommitdiffstats
path: root/examples/tour
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-08-26 20:19:15 +0200
committerLibravatar GitHub <noreply@github.com>2022-08-26 20:19:15 +0200
commit4158a9a0cdde28eeed49c24769497ddd86b6cb9a (patch)
tree14f18fba59f60710229b096aca5b9130b26172e2 /examples/tour
parent59bccb4ca1046074598297040cac5d9904a9a36f (diff)
parenta07cb8588f1ae73b36c181ba200452f863366d11 (diff)
downloadiced-4158a9a0cdde28eeed49c24769497ddd86b6cb9a.tar.gz
iced-4158a9a0cdde28eeed49c24769497ddd86b6cb9a.tar.bz2
iced-4158a9a0cdde28eeed49c24769497ddd86b6cb9a.zip
Merge pull request #1423 from iced-rs/feature/element-explain
Reintroduce `Element::explain`
Diffstat (limited to 'examples/tour')
-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()
}