diff options
author | 2021-10-31 17:02:59 +0700 | |
---|---|---|
committer | 2021-10-31 17:02:59 +0700 | |
commit | 40a5de581144886571504b762719f057dbb2e871 (patch) | |
tree | d931882c7840367c6ddd766e7d9e8cec62d0130f /examples | |
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')
-rw-r--r-- | examples/game_of_life/src/main.rs | 2 | ||||
-rw-r--r-- | examples/pane_grid/src/main.rs | 8 | ||||
-rw-r--r-- | examples/scrollable/src/main.rs | 4 | ||||
-rw-r--r-- | examples/scrollable/src/style.rs | 4 | ||||
-rw-r--r-- | examples/styling/src/main.rs | 6 | ||||
-rw-r--r-- | examples/tooltip/src/main.rs | 2 |
6 files changed, 13 insertions, 13 deletions
diff --git a/examples/game_of_life/src/main.rs b/examples/game_of_life/src/main.rs index 3b5bfa5a..01dcadc6 100644 --- a/examples/game_of_life/src/main.rs +++ b/examples/game_of_life/src/main.rs @@ -150,7 +150,7 @@ impl Application for GameOfLife { Container::new(content) .width(Length::Fill) .height(Length::Fill) - .style(&style::Container) + .style(style::Container) .into() } } diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index 844b604d..8225e9e7 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -178,9 +178,9 @@ impl Application for Example { .controls(pane.controls.view(id, total_panes, pane.is_pinned)) .padding(10) .style(if is_focused { - &style::TitleBar::Focused + style::TitleBar::Focused } else { - &style::TitleBar::Active + style::TitleBar::Active }); pane_grid::Content::new(pane.content.view( @@ -190,9 +190,9 @@ impl Application for Example { )) .title_bar(title_bar) .style(if is_focused { - &style::Pane::Focused + style::Pane::Focused } else { - &style::Pane::Active + style::Pane::Active }) }) .width(Length::Fill) 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(), } } } 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(), } } } diff --git a/examples/tooltip/src/main.rs b/examples/tooltip/src/main.rs index cb2f81df..cfeaf6a6 100644 --- a/examples/tooltip/src/main.rs +++ b/examples/tooltip/src/main.rs @@ -115,7 +115,7 @@ fn tooltip<'a>( ) .gap(5) .padding(10) - .style(&style::Tooltip) + .style(style::Tooltip) .into() } |