summaryrefslogtreecommitdiffstats
path: root/examples/styling
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 16:53:18 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 16:53:18 +0700
commitd36ce33a95c277ee8fe45555df17daf21ef02ef8 (patch)
tree57bc16dda40405c33447bb59a78a4ba33adef7f2 /examples/styling
parent661cb5736ecc6e7810591216aa541db582a2fcc0 (diff)
downloadiced-d36ce33a95c277ee8fe45555df17daf21ef02ef8.tar.gz
iced-d36ce33a95c277ee8fe45555df17daf21ef02ef8.tar.bz2
iced-d36ce33a95c277ee8fe45555df17daf21ef02ef8.zip
Reintroduce `Box` for `style_sheet` in `Button`
Diffstat (limited to 'examples/styling')
-rw-r--r--examples/styling/src/main.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs
index 5ce54e23..9e31c383 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.into());
+ .style(self.theme);
let slider = Slider::new(
&mut self.slider,
@@ -203,11 +203,11 @@ mod style {
}
}
- impl From<Theme> for &'static dyn button::StyleSheet {
+ impl<'a> From<Theme> for Box<dyn button::StyleSheet + 'a> {
fn from(theme: Theme) -> Self {
match theme {
- Theme::Light => &light::Button,
- Theme::Dark => &dark::Button,
+ Theme::Light => light::Button.into(),
+ Theme::Dark => dark::Button.into(),
}
}
}