From eed19dcf81334d0849744f1918ba880d5a7acc1c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 17:39:24 +0700 Subject: Reintroduce `Box` for `style_sheet` in `Scrollable` --- native/src/widget/scrollable.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'native') diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index 781fe73e..05e9b347 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -27,7 +27,7 @@ pub struct Scrollable<'a, Message, Renderer> { scroller_width: u16, content: Column<'a, Message, Renderer>, on_scroll: Option Message>>, - style_sheet: &'a dyn StyleSheet, + style_sheet: Box, } impl<'a, Message, Renderer: crate::Renderer> Scrollable<'a, Message, Renderer> { @@ -123,8 +123,11 @@ impl<'a, Message, Renderer: crate::Renderer> Scrollable<'a, Message, Renderer> { } /// Sets the style of the [`Scrollable`] . - 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>, + ) -> Self { + self.style_sheet = style_sheet.into(); self } -- cgit