summaryrefslogtreecommitdiffstats
path: root/web/src/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-18 14:48:33 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-18 14:48:33 +0700
commit54a9a232f8110364972a8eef966b7b7477573f4f (patch)
treea6abebbcfefbd53d4c4d006d6911353801ea3284 /web/src/widget
parenta4f4d831615899046d36c96e6a580d5386aa25bf (diff)
downloadiced-54a9a232f8110364972a8eef966b7b7477573f4f.tar.gz
iced-54a9a232f8110364972a8eef966b7b7477573f4f.tar.bz2
iced-54a9a232f8110364972a8eef966b7b7477573f4f.zip
Draw scrollbar in `Widget::draw` for `Scrollable`
Diffstat (limited to 'web/src/widget')
-rw-r--r--web/src/widget/scrollable.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/web/src/widget/scrollable.rs b/web/src/widget/scrollable.rs
index 847bf5a0..595eb26e 100644
--- a/web/src/widget/scrollable.rs
+++ b/web/src/widget/scrollable.rs
@@ -14,7 +14,7 @@ pub struct Scrollable<'a, Message> {
max_height: u32,
content: Column<'a, Message>,
#[allow(dead_code)]
- style: Box<dyn StyleSheet>,
+ style_sheet: &'a dyn StyleSheet,
}
impl<'a, Message> Scrollable<'a, Message> {
@@ -27,7 +27,7 @@ impl<'a, Message> Scrollable<'a, Message> {
height: Length::Shrink,
max_height: u32::MAX,
content: Column::new(),
- style: Default::default(),
+ style_sheet: Default::default(),
}
}
@@ -78,8 +78,11 @@ impl<'a, Message> Scrollable<'a, Message> {
}
/// Sets the style of the [`Scrollable`] .
- pub fn style(mut self, style: impl Into<Box<dyn StyleSheet>>) -> Self {
- self.style = style.into();
+ pub fn style<'b>(mut self, style_sheet: &'b dyn StyleSheet) -> Self
+ where
+ 'b: 'a,
+ {
+ self.style_sheet = style_sheet;
self
}