From d61cb58d92b6fcd520f665deb093f3747ffd5e5c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 18 Oct 2021 15:36:32 +0700 Subject: Wire up `container` styling to `iced_native` --- examples/scrollable/src/main.rs | 4 ++-- examples/scrollable/src/style.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/scrollable/src') diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs index 272f0ce2..bc20d428 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), + .style(theme.clone().into()), ) .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) + .style(self.theme.into()) .into() } } diff --git a/examples/scrollable/src/style.rs b/examples/scrollable/src/style.rs index d955f52d..66f3b9d3 100644 --- a/examples/scrollable/src/style.rs +++ b/examples/scrollable/src/style.rs @@ -16,11 +16,11 @@ impl Default for Theme { } } -impl From for Box { +impl From for &'static dyn container::StyleSheet { fn from(theme: Theme) -> Self { match theme { Theme::Light => Default::default(), - Theme::Dark => dark::Container.into(), + Theme::Dark => &dark::Container, } } } -- cgit