Reintroduce Box for style_sheet in Container
This commit is contained in:
parent
fcc282bd76
commit
40a5de5811
12 changed files with 51 additions and 30 deletions
|
|
@ -20,7 +20,7 @@ pub struct Tooltip<'a, Message, Renderer: text::Renderer> {
|
|||
content: Element<'a, Message, Renderer>,
|
||||
tooltip: Text<Renderer>,
|
||||
position: Position,
|
||||
style_sheet: &'a dyn container::StyleSheet,
|
||||
style_sheet: Box<dyn container::StyleSheet + 'a>,
|
||||
gap: u16,
|
||||
padding: u16,
|
||||
}
|
||||
|
|
@ -77,8 +77,11 @@ where
|
|||
}
|
||||
|
||||
/// Sets the style of the [`Tooltip`].
|
||||
pub fn style(mut self, style_sheet: &'a dyn container::StyleSheet) -> Self {
|
||||
self.style_sheet = style_sheet;
|
||||
pub fn style(
|
||||
mut self,
|
||||
style_sheet: impl Into<Box<dyn container::StyleSheet + 'a>>,
|
||||
) -> Self {
|
||||
self.style_sheet = style_sheet.into();
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue