From 969d0400d2b86b6e74cfa09d17f873164c348b68 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Tue, 12 Mar 2024 01:07:17 +0100 Subject: [PATCH] add docs --- hui/src/element/builtin/interactable.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hui/src/element/builtin/interactable.rs b/hui/src/element/builtin/interactable.rs index 5addcbe..8aa2079 100644 --- a/hui/src/element/builtin/interactable.rs +++ b/hui/src/element/builtin/interactable.rs @@ -64,9 +64,15 @@ impl UiElement for Interactable { } } +/// Extension trait for [`UiElement`] that adds methods to wrap the element in an [`Interactable`] pub trait ElementInteractableExt: UiElement { + /// Wrap the element in an [`Interactable`] that will call the given signal when the specified event occurs fn into_interactable(self, event: InteractableEvent, signal: C) -> Interactable; + + /// Wrap the element in an [`Interactable`] that will call the given signal when clicked fn on_click(self, signal: C) -> Interactable; + + /// Wrap the element in an [`Interactable`] that will call the given signal while hovered fn on_hover(self, signal: C) -> Interactable; }