summaryrefslogtreecommitdiffstats
path: root/web/src/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:02:59 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:02:59 +0700
commit40a5de581144886571504b762719f057dbb2e871 (patch)
treed931882c7840367c6ddd766e7d9e8cec62d0130f /web/src/widget
parentfcc282bd76c88f389d510411b0ae73e1a4eaf317 (diff)
downloadiced-40a5de581144886571504b762719f057dbb2e871.tar.gz
iced-40a5de581144886571504b762719f057dbb2e871.tar.bz2
iced-40a5de581144886571504b762719f057dbb2e871.zip
Reintroduce `Box` for `style_sheet` in `Container`
Diffstat (limited to 'web/src/widget')
-rw-r--r--web/src/widget/container.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/web/src/widget/container.rs b/web/src/widget/container.rs
index e61600c4..8e345b9a 100644
--- a/web/src/widget/container.rs
+++ b/web/src/widget/container.rs
@@ -19,7 +19,7 @@ pub struct Container<'a, Message> {
max_height: u32,
horizontal_alignment: alignment::Horizontal,
vertical_alignment: alignment::Vertical,
- style_sheet: &'a dyn StyleSheet,
+ style_sheet: Box<dyn StyleSheet + 'a>,
content: Element<'a, Message>,
}
@@ -89,8 +89,8 @@ impl<'a, Message> Container<'a, Message> {
}
/// Sets the style of the [`Container`].
- pub fn style(mut self, style: &'a dyn StyleSheet) -> Self {
- self.style_sheet = style;
+ pub fn style(mut self, style: impl Into<Box<dyn StyleSheet + 'a>>) -> Self {
+ self.style_sheet = style.into();
self
}
}