diff options
author | 2024-02-01 21:23:18 -0500 | |
---|---|---|
committer | 2024-02-09 02:10:07 +0100 | |
commit | 6bafdc4b3cd907697f315ac2db2c33938a178956 (patch) | |
tree | 2da63646d9f9416e9aac746764ba7e7d123a5ff8 /widget/src/helpers.rs | |
parent | 073466708eef2b4c6331244e905f6739d8dfb076 (diff) | |
download | iced-6bafdc4b3cd907697f315ac2db2c33938a178956.tar.gz iced-6bafdc4b3cd907697f315ac2db2c33938a178956.tar.bz2 iced-6bafdc4b3cd907697f315ac2db2c33938a178956.zip |
Add support for a generic `Element` in `Tooltip`
Diffstat (limited to 'widget/src/helpers.rs')
-rw-r--r-- | widget/src/helpers.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<Element<'a, Message, Theme, Renderer>>, - tooltip: impl ToString, + tooltip: impl Into<Element<'a, Message, Theme, Renderer>>, 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. |