From 6bafdc4b3cd907697f315ac2db2c33938a178956 Mon Sep 17 00:00:00 2001 From: jhannyj Date: Thu, 1 Feb 2024 21:23:18 -0500 Subject: Add support for a generic `Element` in `Tooltip` --- widget/src/helpers.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'widget/src/helpers.rs') diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs index 3f34d165..a643add3 100644 --- a/widget/src/helpers.rs +++ b/widget/src/helpers.rs @@ -123,20 +123,20 @@ where Button::new(content) } -/// Creates a new [`Tooltip`] with the provided content, tooltip text, and [`tooltip::Position`]. +/// Creates a new [`Tooltip`] with the provided content, tooltip element, and [`tooltip::Position`]. /// /// [`Tooltip`]: crate::Tooltip /// [`tooltip::Position`]: crate::tooltip::Position pub fn tooltip<'a, Message, Theme, Renderer>( content: impl Into>, - tooltip: impl ToString, + tooltip: impl Into>, position: tooltip::Position, ) -> crate::Tooltip<'a, Message, Theme, Renderer> where Theme: container::StyleSheet + text::StyleSheet, Renderer: core::text::Renderer, { - Tooltip::new(content, tooltip.to_string(), position) + Tooltip::new(content, tooltip, position) } /// Creates a new [`Text`] widget with the provided content. -- cgit