diff options
Diffstat (limited to '')
| -rw-r--r-- | iced_builder/src/widget.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/iced_builder/src/widget.rs b/iced_builder/src/widget.rs new file mode 100644 index 0000000..ed2073a --- /dev/null +++ b/iced_builder/src/widget.rs @@ -0,0 +1,21 @@ +use iced::widget::{container, text, tooltip}; +use iced::Element; + +pub mod tip { + pub use super::tooltip::Position; +} + +pub fn tip<'a, Message: 'a>( + target: impl Into<Element<'a, Message>>, + tip: &'a str, + position: tip::Position, +) -> Element<'a, Message> { + tooltip( + target, + container(text(tip).size(14)) + .padding(5) + .style(container::rounded_box), + position, + ) + .into() +} |
