summaryrefslogtreecommitdiffstats
path: root/examples/scrollable
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:02:59 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:02:59 +0700
commit40a5de581144886571504b762719f057dbb2e871 (patch)
treed931882c7840367c6ddd766e7d9e8cec62d0130f /examples/scrollable
parentfcc282bd76c88f389d510411b0ae73e1a4eaf317 (diff)
downloadiced-40a5de581144886571504b762719f057dbb2e871.tar.gz
iced-40a5de581144886571504b762719f057dbb2e871.tar.bz2
iced-40a5de581144886571504b762719f057dbb2e871.zip
Reintroduce `Box` for `style_sheet` in `Container`
Diffstat (limited to 'examples/scrollable')
-rw-r--r--examples/scrollable/src/main.rs4
-rw-r--r--examples/scrollable/src/style.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs
index 2f1c5676..2eaf197e 100644
--- a/examples/scrollable/src/main.rs
+++ b/examples/scrollable/src/main.rs
@@ -164,7 +164,7 @@ impl Sandbox for ScrollableDemo {
Container::new(scrollable)
.width(Length::Fill)
.height(Length::Fill)
- .style(theme.clone().into()),
+ .style(*theme),
)
.push(ProgressBar::new(
0.0..=1.0,
@@ -190,7 +190,7 @@ impl Sandbox for ScrollableDemo {
.height(Length::Fill)
.center_x()
.center_y()
- .style(self.theme.into())
+ .style(self.theme)
.into()
}
}
diff --git a/examples/scrollable/src/style.rs b/examples/scrollable/src/style.rs
index d7d64374..068483cb 100644
--- a/examples/scrollable/src/style.rs
+++ b/examples/scrollable/src/style.rs
@@ -16,11 +16,11 @@ impl Default for Theme {
}
}
-impl From<Theme> for &'static dyn container::StyleSheet {
+impl<'a> From<Theme> for Box<dyn container::StyleSheet + 'a> {
fn from(theme: Theme) -> Self {
match theme {
Theme::Light => Default::default(),
- Theme::Dark => &dark::Container,
+ Theme::Dark => dark::Container.into(),
}
}
}