summaryrefslogtreecommitdiffstats
path: root/native/src/widget/container.rs
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/widget/container.rs')
-rw-r--r--native/src/widget/container.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/native/src/widget/container.rs b/native/src/widget/container.rs
index 006e07c6..5ad07d6d 100644
--- a/native/src/widget/container.rs
+++ b/native/src/widget/container.rs
@@ -28,7 +28,7 @@ pub struct Container<'a, Message, Renderer> {
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, Renderer>,
}
@@ -109,8 +109,11 @@ where
}
/// Sets the style of the [`Container`].
- pub fn style(mut self, style_sheet: &'a dyn StyleSheet) -> Self {
- self.style_sheet = style_sheet;
+ pub fn style(
+ mut self,
+ style_sheet: impl Into<Box<dyn StyleSheet + 'a>>,
+ ) -> Self {
+ self.style_sheet = style_sheet.into();
self
}
}