Reintroduce Element::explain

This commit is contained in:
Héctor Ramón Jiménez 2022-08-26 20:04:02 +02:00
parent da7e859840
commit a07cb8588f
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
2 changed files with 193 additions and 13 deletions

View file

@ -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()
}