summaryrefslogtreecommitdiff
path: root/src/widget.rs
diff options
context:
space:
mode:
authorpml68 <contact@pml68.dev>2025-01-11 01:50:16 +0100
committerpml68 <contact@pml68.dev>2025-01-11 01:50:16 +0100
commit61926598ce96bee00aafe5340af4a905759b122a (patch)
treeb79e13b3decc778cc7c66af7187c647ae0a21a52 /src/widget.rs
parentrefactor: apply clippy suggestions (diff)
downloadiced-builder-61926598ce96bee00aafe5340af4a905759b122a.tar.gz
refactor: remove iced_drop & workspace
Diffstat (limited to 'src/widget.rs')
-rw-r--r--src/widget.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/widget.rs b/src/widget.rs
new file mode 100644
index 0000000..ed2073a
--- /dev/null
+++ b/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()
+}