pub struct Clickable<T, V, F>{
pub content: Pod<V>,
pub descendants: bool,
pub button: Option<PointerButton>,
pub event: ClickEvent,
pub callback: F,
/* private fields */
}Expand description
A click handler.
Fields§
§content: Pod<V>The content.
descendants: boolWhether the item should be clickable when it’s descendants are clicked.
Defaults to true.
The button to listen for.
If Some the callbacks will only be called when this button is pressed.
event: ClickEventThe event to listen for.
callback: FThe callback.
Implementations§
Source§impl<T, V, F> Clickable<T, V, F>
impl<T, V, F> Clickable<T, V, F>
Sourcepub fn content(self, content: impl Into<Pod<V>>) -> Clickable<T, V, F>
pub fn content(self, content: impl Into<Pod<V>>) -> Clickable<T, V, F>
Set self.content.
The content.
Sourcepub fn descendants(self, descendants: impl Into<bool>) -> Clickable<T, V, F>
pub fn descendants(self, descendants: impl Into<bool>) -> Clickable<T, V, F>
Set self.descendants.
Whether the item should be clickable when it’s descendants are clicked.
Defaults to true.
Set self.button.
The button to listen for.
If Some the callbacks will only be called when this button is pressed.
Sourcepub fn event(self, event: impl Into<ClickEvent>) -> Clickable<T, V, F>
pub fn event(self, event: impl Into<ClickEvent>) -> Clickable<T, V, F>
Set self.event.
The event to listen for.
Trait Implementations§
Source§impl<T, V, F> View<T> for Clickable<T, V, F>
impl<T, V, F> View<T> for Clickable<T, V, F>
Source§type State = PodState<T, V>
type State = PodState<T, V>
The state of the view, see top-level documentation for more information.
Source§fn build(
&mut self,
cx: &mut BuildCx<'_, '_>,
data: &mut T,
) -> <Clickable<T, V, F> as View<T>>::State
fn build( &mut self, cx: &mut BuildCx<'_, '_>, data: &mut T, ) -> <Clickable<T, V, F> as View<T>>::State
Build the view state, see top-level documentation for more information.
Source§fn rebuild(
&mut self,
content: &mut <Clickable<T, V, F> as View<T>>::State,
cx: &mut RebuildCx<'_, '_>,
data: &mut T,
old: &Clickable<T, V, F>,
)
fn rebuild( &mut self, content: &mut <Clickable<T, V, F> as View<T>>::State, cx: &mut RebuildCx<'_, '_>, data: &mut T, old: &Clickable<T, V, F>, )
Rebuild the view state, see top-level documentation for more information.
Source§fn event(
&mut self,
content: &mut <Clickable<T, V, F> as View<T>>::State,
cx: &mut EventCx<'_, '_>,
data: &mut T,
event: &Event,
) -> bool
fn event( &mut self, content: &mut <Clickable<T, V, F> as View<T>>::State, cx: &mut EventCx<'_, '_>, data: &mut T, event: &Event, ) -> bool
Handle an event, see top-level documentation for more information.
Auto Trait Implementations§
impl<T, V, F> Freeze for Clickable<T, V, F>
impl<T, V, F> RefUnwindSafe for Clickable<T, V, F>where
F: RefUnwindSafe,
V: RefUnwindSafe,
impl<T, V, F> Send for Clickable<T, V, F>
impl<T, V, F> Sync for Clickable<T, V, F>
impl<T, V, F> Unpin for Clickable<T, V, F>
impl<T, V, F> UnwindSafe for Clickable<T, V, F>where
F: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
Source§impl<T, V> AnyView<T> for V
impl<T, V> AnyView<T> for V
Source§fn dyn_build(&mut self, cx: &mut BuildCx<'_, '_>, data: &mut T) -> Box<dyn Any>
fn dyn_build(&mut self, cx: &mut BuildCx<'_, '_>, data: &mut T) -> Box<dyn Any>
Build the view.
Source§fn dyn_rebuild(
&mut self,
state: &mut Box<dyn Any>,
cx: &mut RebuildCx<'_, '_>,
data: &mut T,
old: &dyn AnyView<T>,
)
fn dyn_rebuild( &mut self, state: &mut Box<dyn Any>, cx: &mut RebuildCx<'_, '_>, data: &mut T, old: &dyn AnyView<T>, )
Rebuild the view.
Source§fn dyn_event(
&mut self,
state: &mut Box<dyn Any>,
cx: &mut EventCx<'_, '_>,
data: &mut T,
event: &Event,
) -> bool
fn dyn_event( &mut self, state: &mut Box<dyn Any>, cx: &mut EventCx<'_, '_>, data: &mut T, event: &Event, ) -> bool
Handle an event.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more