summaryrefslogtreecommitdiffstats
path: root/examples/tour/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/tour/src/main.rs')
-rw-r--r--examples/tour/src/main.rs22
1 files changed, 9 insertions, 13 deletions
diff --git a/examples/tour/src/main.rs b/examples/tour/src/main.rs
index d8c0b29a..32720c47 100644
--- a/examples/tour/src/main.rs
+++ b/examples/tour/src/main.rs
@@ -1,6 +1,6 @@
use iced::widget::{
- button, checkbox, column, container, horizontal_space, image, radio, row,
- scrollable, slider, text, text_input, toggler, vertical_space,
+ button, center_x, center_y, checkbox, column, horizontal_space, image,
+ radio, row, scrollable, slider, text, text_input, toggler, vertical_space,
};
use iced::widget::{Button, Column, Container, Slider};
use iced::{Center, Color, Element, Fill, Font, Pixels};
@@ -166,16 +166,13 @@ impl Tour {
.padding(20)
.into();
- let scrollable = scrollable(
- container(if self.debug {
- content.explain(Color::BLACK)
- } else {
- content
- })
- .center_x(Fill),
- );
+ let scrollable = scrollable(center_x(if self.debug {
+ content.explain(Color::BLACK)
+ } else {
+ content
+ }));
- container(scrollable).center_y(Fill).into()
+ center_y(scrollable).into()
}
fn can_continue(&self) -> bool {
@@ -543,7 +540,7 @@ fn ferris<'a>(
width: u16,
filter_method: image::FilterMethod,
) -> Container<'a, Message> {
- container(
+ center_x(
// This should go away once we unify resource loading on native
// platforms
if cfg!(target_arch = "wasm32") {
@@ -554,7 +551,6 @@ fn ferris<'a>(
.filter_method(filter_method)
.width(width),
)
- .center_x(Fill)
}
fn padded_button<Message: Clone>(label: &str) -> Button<'_, Message> {