diff options
author | 2021-10-18 16:02:30 +0700 | |
---|---|---|
committer | 2021-10-18 16:02:30 +0700 | |
commit | 3140cdc4babcefc444f1c1d30eb0f5f4ed1df054 (patch) | |
tree | b3ea963a73118d5f0bfd7d875ba776ee51466f9b /examples/styling | |
parent | 95acc1deb89c4e75b513edb0f4d53b83c7f75b30 (diff) | |
download | iced-3140cdc4babcefc444f1c1d30eb0f5f4ed1df054.tar.gz iced-3140cdc4babcefc444f1c1d30eb0f5f4ed1df054.tar.bz2 iced-3140cdc4babcefc444f1c1d30eb0f5f4ed1df054.zip |
Wire up styling to `Button` in `iced_native`
Diffstat (limited to 'examples/styling')
-rw-r--r-- | examples/styling/src/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index d8254dd9..38ab0411 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -82,7 +82,7 @@ impl Sandbox for Styling { let button = Button::new(&mut self.button, Text::new("Submit")) .padding(10) .on_press(Message::ButtonPressed) - .style(self.theme); + .style(self.theme.into()); let slider = Slider::new( &mut self.slider, @@ -203,11 +203,11 @@ mod style { } } - impl From<Theme> for Box<dyn button::StyleSheet> { + impl From<Theme> for &'static dyn button::StyleSheet { fn from(theme: Theme) -> Self { match theme { - Theme::Light => light::Button.into(), - Theme::Dark => dark::Button.into(), + Theme::Light => &light::Button, + Theme::Dark => &dark::Button, } } } |