diff options
author | 2021-10-31 17:02:59 +0700 | |
---|---|---|
committer | 2021-10-31 17:02:59 +0700 | |
commit | 40a5de581144886571504b762719f057dbb2e871 (patch) | |
tree | d931882c7840367c6ddd766e7d9e8cec62d0130f /examples/styling | |
parent | fcc282bd76c88f389d510411b0ae73e1a4eaf317 (diff) | |
download | iced-40a5de581144886571504b762719f057dbb2e871.tar.gz iced-40a5de581144886571504b762719f057dbb2e871.tar.bz2 iced-40a5de581144886571504b762719f057dbb2e871.zip |
Reintroduce `Box` for `style_sheet` in `Container`
Diffstat (limited to 'examples/styling')
-rw-r--r-- | examples/styling/src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index e8829b53..3692ad1e 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -149,7 +149,7 @@ impl Sandbox for Styling { .height(Length::Fill) .center_x() .center_y() - .style(self.theme.into()) + .style(self.theme) .into() } } @@ -176,11 +176,11 @@ mod style { } } - 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(), } } } |