diff options
| author | Polesznyák Márk László <116908301+pml68@users.noreply.github.com> | 2024-12-26 00:12:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-26 00:12:06 +0100 |
| commit | 0ae3ec6cc9babcab39c76f023606229a151916ab (patch) | |
| tree | e92d0109599622984b2c485cc020951da288cec3 /iced_builder/src/widget.rs | |
| parent | Merge pull request #3 from pml68/refactor/internal-restructuring (diff) | |
| parent | feat: add `tip` widget helper from `hecrj/icebreaker` (diff) | |
| download | iced-builder-0ae3ec6cc9babcab39c76f023606229a151916ab.tar.gz | |
Merge pull request #4 from pml68/feat/playground
Playground done **for now**
Diffstat (limited to 'iced_builder/src/widget.rs')
| -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() +} |
