use fission::prelude::*;
fission_component! {
pub TimelineGestureArea<()> {
props {
timeline: Widget,
begin_scrub: ActionEnvelope,
scrub: ActionEnvelope,
finish_scrub: ActionEnvelope,
}
}
view(area, _state, _cx) =>
GestureDetector(
child: area.timeline.clone(),
on_drag_start: area.begin_scrub.clone(),
on_drag_update: area.scrub.clone(),
on_drag_end: area.finish_scrub.clone(),
)
}
Field | Type | Meaning | Notes / default behavior |
|---|---|---|---|
id | Option<WidgetId> | Stable widget identity. | Defaults to None. |
child | Widget | The wrapped child that receives gesture detection. | Required. Default uses an empty spacer child. |
on_tap | Option<ActionEnvelope> | Action for a normal tap. | When present, the lowered semantics become focusable. |
on_double_tap | Option<ActionEnvelope> | Action for a double tap. | Defaults to None. |
on_long_press | Option<ActionEnvelope> | Action for a long press. | Defaults to None. |
on_drag_start | Option<ActionEnvelope> | Action for drag start. | Defaults to None. |
on_drag_update | Option<ActionEnvelope> | Action for drag movement. | Defaults to None. |
on_drag_end | Option<ActionEnvelope> | Action for drag end. | Defaults to None. |
on_hover_enter | Option<ActionEnvelope> | Action when the pointer enters the bounds. | Useful on desktop and web. |
on_hover_exit | Option<ActionEnvelope> | Action when the pointer leaves the bounds. | Useful on desktop and web. |
on_drop | Option<ActionEnvelope> | Action when a drag payload is dropped on this widget. | Defaults to None. |
on_secondary_click | Option<ActionEnvelope> | Action for right click or equivalent secondary click. | Defaults to None. |
on_drag_enter | Option<ActionEnvelope> | Action when a drag enters the target bounds. | Defaults to None. |
on_drag_leave | Option<ActionEnvelope> | Action when a drag leaves the target bounds. | Defaults to None. |
drag_payload | Option<Vec<u8>> | Opaque bytes attached to drag sources. | Defaults to None. Also marks the widget as draggable. |