summaryrefslogtreecommitdiff
path: root/iced_builder/src/widget.rs
diff options
context:
space:
mode:
authorPolesznyák Márk László <116908301+pml68@users.noreply.github.com>2024-12-26 00:12:06 +0100
committerGitHub <noreply@github.com>2024-12-26 00:12:06 +0100
commit0ae3ec6cc9babcab39c76f023606229a151916ab (patch)
treee92d0109599622984b2c485cc020951da288cec3 /iced_builder/src/widget.rs
parentMerge pull request #3 from pml68/refactor/internal-restructuring (diff)
parentfeat: add `tip` widget helper from `hecrj/icebreaker` (diff)
downloadiced-builder-0ae3ec6cc9babcab39c76f023606229a151916ab.tar.gz
Merge pull request #4 from pml68/feat/playground
Playground done **for now**
Diffstat (limited to '')
-rw-r--r--iced_builder/src/widget.rs21
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()
+}