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; }