summaryrefslogtreecommitdiffstats
path: root/native/src/widget/tooltip.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--native/src/widget/tooltip.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/native/src/widget/tooltip.rs b/native/src/widget/tooltip.rs
index a7f3a042..5a6cd923 100644
--- a/native/src/widget/tooltip.rs
+++ b/native/src/widget/tooltip.rs
@@ -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
}
}