pub struct MenuItem { /* private fields */ }Expand description
A single command row in a MenuList or context menu.
See the module documentation for the full mode table, mnemonic syntax, and submenu construction pattern.
Implementations§
Source§impl MenuItem
impl MenuItem
Sourcepub fn new(label: impl Into<LocalizedString>) -> Self
pub fn new(label: impl Into<LocalizedString>) -> Self
Create a plain menu item with the given label and no action yet.
Sourcepub fn on_activate_fn(self, f: impl Fn(&mut EventContext<'_>) + 'static) -> Self
pub fn on_activate_fn(self, f: impl Fn(&mut EventContext<'_>) + 'static) -> Self
Closure invoked on activation. Note: shortcut label auto-lookup is not available with this variant since there is no typed command to look up.
Sourcepub fn label(&self) -> String
pub fn label(&self) -> String
Read the item’s display label. Exposed so SplitButton (and any other compound widget that embeds a MenuItem) can mirror the label in its own chrome.
Sourcepub fn label_localized(&self) -> LocalizedString
pub fn label_localized(&self) -> LocalizedString
Like label but returns the unresolved
[LocalizedString], so embedders can mirror the label reactively
(re-resolving on a locale switch) instead of freezing a snapshot.
Sourcepub fn action(&self) -> Option<Rc<dyn Fn(&mut EventContext<'_>)>>
pub fn action(&self) -> Option<Rc<dyn Fn(&mut EventContext<'_>)>>
Clone out a shared handle to the activation closure. Returns None
when this MenuItem has no action (e.g. it’s a submenu trigger). The
returned Rc aliases MenuItem’s own internal handle — invoking it
has the same effect as the user clicking this menu item (minus the
overlay dismissal that the tap handler also performs).
Sourcepub fn icon(self, icon: IconWidget) -> Self
pub fn icon(self, icon: IconWidget) -> Self
Set a leading icon.
Sourcepub fn icon_keeps_color(self) -> Self
pub fn icon_keeps_color(self) -> Self
Keep the icon’s own colour rather than tinting it with the row’s.
A menu icon normally says the same thing as the label beside it, so it takes
the row’s text role and follows it through hover, press and disabled — which
is why icon recolours whatever it is handed. Some icons are
not that. A tag’s swatch, a status light, a colour a person chose: there the
colour is the content, and tinting it to the menu’s foreground deletes the
only thing the icon was there to say.
Opt-in, because the default is right for nearly every row, and keeping a colour has two costs the caller takes on:
- It does not follow the highlight. On a style whose highlighted row is a solid accent fill (the macOS recipe), the icon has to carry its own contrast against that fill as well as against the menu’s surface.
- It does not dim when the row is disabled — if it is a literal colour.
That is
ColorProp’s own rule everywhere, not a special case here:StaticandBoundignore the enabled state, while every role variant substitutes its disabled counterpart. An icon that should dim should be given a role instead, and then it does not need this at all.
Ignored in the check and radio modes, which draw an indicator glyph of the framework’s own rather than the caller’s icon.
Sourcepub fn shortcut_label(self, label: impl Into<String>) -> Self
pub fn shortcut_label(self, label: impl Into<String>) -> Self
Set a trailing shortcut label (e.g., “Ctrl+X”). Shortcut labels are typically not translated (they’re the key combination literal), so this accepts a plain string.
Sourcepub fn trailing_hint(self, text: impl Into<LocalizedString>) -> Self
pub fn trailing_hint(self, text: impl Into<LocalizedString>) -> Self
Set a trailing descriptive hint (e.g. “inside”, “after parent”) — a secondary phrase explaining what the item will do, rendered in the same trailing slot as an accelerator but semantically unrelated to one.
Prefer this over shortcut_label for any
trailing text that is not a key combination. It differs in two ways
that matter:
- it takes a [
LocalizedString], so atr!(...)hint re-resolves on a live locale change instead of being frozen at build time; - it is announced as the item’s accessible description, not as
keyboard_shortcut— a screen reader would otherwise read the phrase out as if it were a chord to press.
Independent of the accelerator: an item may carry both, in which case the chord renders first and the hint follows it.
Sourcepub fn for_shortcut(self, id: &'static str) -> Self
pub fn for_shortcut(self, id: &'static str) -> Self
Bind the trailing shortcut label to a registered
Shortcut by its stable id.
At build time the effective primary keystroke is rendered;
rebinds performed through
ShortcutRegistry
rebuild this item automatically via the registry’s version
signal.
A manual shortcut_label takes
precedence when both are set.
Sourcepub fn enabled(self, enabled: impl Into<Prop<bool>>) -> Self
pub fn enabled(self, enabled: impl Into<Prop<bool>>) -> Self
Set the enabled state — static or signal-bound. A bound Signal<bool>
enables/disables the item reactively (paint and AT follow), so
MenuItem::new(...).enabled(can_save_signal) greys out live without a
rebuild. Cursor is always Pointer (see build); disabled items are
gated by the arena before hover runs, so a NotAllowed cursor cannot
be applied from a build-time snapshot of this prop either.
Sourcepub fn style(self, style: impl MenuItemStyle) -> Self
pub fn style(self, style: impl MenuItemStyle) -> Self
Per-call style override. Replaces the theme-wide default
MenuItemStyle for just this MenuItem instance.
Sourcepub fn text_style(self, style: impl Into<TextStyleProp>) -> Self
pub fn text_style(self, style: impl Into<TextStyleProp>) -> Self
Override the label’s text style (font, size, weight). Accepts a
TextStyleRole, a TextStyle, or a Signal of either. Default
(unset) is TextStyleRole::Body.
Sourcepub fn text_role(self, color: impl Into<ColorProp>) -> Self
pub fn text_role(self, color: impl Into<ColorProp>) -> Self
Override the label text color. Accepts Color, a role, or a
Signal of either. Default (unset) is the interaction/enabled
cascade; setting this replaces that cascade (the hover / disabled
tint no longer applies), so reserve it for chrome that enforces a
fixed text role.
Sourcepub fn tooltip(self, text: impl Into<LocalizedString>) -> Self
pub fn tooltip(self, text: impl Into<LocalizedString>) -> Self
Attach a tooltip that appears after a hover delay, same mechanism
as Button::tooltip.
Sourcepub fn rich_tooltip(self, key: impl Into<String>) -> Self
pub fn rich_tooltip(self, key: impl Into<String>) -> Self
Attach a rich tooltip resolved from the app-wide tooltip
registry. Body text supports inline markup
([label](url), *italic*, **bold**); the entry’s shortcut
and long-form “more” fields are rendered automatically.
Sourcepub fn rich_tooltip_content(self, content: TooltipContent) -> Self
pub fn rich_tooltip_content(self, content: TooltipContent) -> Self
Attach a rich tooltip driven by inline TooltipContent.
Sourcepub fn composite_tooltip(self, content: impl Widget + 'static) -> Self
pub fn composite_tooltip(self, content: impl Widget + 'static) -> Self
Attach a composite tooltip — third tier, hosting an arbitrary
widget tree. See Button::composite_tooltip.
Create a submenu trigger item. The factory is invoked during build() to
pre-create the submenu content (typically a MenuList), which is kept
dormant until the hover delay elapses.
Set a custom submenu open delay (default: 200ms).
Whether this is a submenu trigger.
Sourcepub fn checked(self, state: Signal<bool>) -> Self
pub fn checked(self, state: Signal<bool>) -> Self
Bind this item to a two-state Signal<bool>. The item renders
Role::MenuItemCheckBox; activation flips the signal. By
Windows convention, the leading icon slot becomes a checkmark
when the signal is true, blank otherwise.
Mutually exclusive with check_state
and radio — last call wins.
Sourcepub fn reflect_checked(self, state: impl Into<Prop<bool>>) -> Self
pub fn reflect_checked(self, state: impl Into<Prop<bool>>) -> Self
Render Role::MenuItemCheckBox whose checkmark reflects state
read-only: activation does NOT write the signal — the truth lives
elsewhere (a model / method), and this item’s on_activate/intent is
responsible for the change, after which state updates the checkmark
reactively. Use for “View ▸ Sidebar / Full Screen”-style commands that
mirror externally-owned state (e.g. DockingModel::dock_open_signal),
where two-way checked would fight the model.
Mutually exclusive with the other check / radio binders — last call wins.
Sourcepub fn check_state(self, state: Signal<CheckState>) -> Self
pub fn check_state(self, state: Signal<CheckState>) -> Self
Bind this item to a tri-state Signal<CheckState>. The item
renders Role::MenuItemCheckBox; activation cycles
Unchecked ↔ Checked (per Windows / Checkbox
convention: Indeterminate is reserved for external sources
like TreeCheckedModel; clicking from Indeterminate
promotes to Checked).
The leading-slot glyph is checkmark for Checked, dash
for Indeterminate, blank for Unchecked — matching the
Windows mixed-state convention.
Sourcepub fn radio(self, value: usize, selected: Signal<usize>) -> Self
pub fn radio(self, value: usize, selected: Signal<usize>) -> Self
Bind this item to a radio group via a shared Signal<usize>.
Activation writes value into selected; all radio items
sharing the same selected signal observe the change and
update their leading-slot dot accordingly. The item renders
Role::MenuItemRadio.
For “2 of 3”-style AT announcement, the enclosing
MenuList groups radio items
by selection-signal identity and emits push_to_radio_group
relationships automatically — no app-side wiring required.
Mutually exclusive with checked
and check_state — last call
wins.
Trait Implementations§
Source§impl Widget for MenuItem
impl Widget for MenuItem
Source§fn as_any(&self) -> Option<&dyn Any>
fn as_any(&self) -> Option<&dyn Any>
Opt into reflection so MenuList::build
can downcast a pending boxed item and install its radio group
buffer before the item is added to the arena.
Source§fn build(&mut self, ctx: &mut BuildContext<'_>) -> Vec<WidgetId>
fn build(&mut self, ctx: &mut BuildContext<'_>) -> Vec<WidgetId>
&mut self — store child IDs, signal handles, any state needed later.
Returns the list of root child IDs (empty for leaf widgets).Source§fn layout_response(
&self,
proposal: SizeProposal,
ctx: &LayoutContext<'_>,
) -> LayoutResponse
fn layout_response( &self, proposal: SizeProposal, ctx: &LayoutContext<'_>, ) -> LayoutResponse
LayoutResponse]). Read moreSource§fn place_children(
&self,
bounds: Rect,
_proposal: SizeProposal,
children: &mut [WidgetPlacement],
_ctx: &LayoutContext<'_>,
)
fn place_children( &self, bounds: Rect, _proposal: SizeProposal, children: &mut [WidgetPlacement], _ctx: &LayoutContext<'_>, )
Source§fn accessibility(&self, builder: &mut AccessNodeBuilder)
fn accessibility(&self, builder: &mut AccessNodeBuilder)
Source§fn as_any_mut(&mut self) -> Option<&mut dyn Any>
fn as_any_mut(&mut self) -> Option<&mut dyn Any>
as_any. Default
returns None; widgets that want to expose mutable state to
tests (e.g. so a test can mutate a Scene inside a
SceneView post-layout) override with Some(self). Should
follow the same opt-in pattern as as_any: only widgets
that opt into & introspection should opt into &mut.§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
"teksilo_widgets::button::Button"). The default implementation
resolves at the impl site via std::any::type_name::<Self>(),
so calls through &dyn Widget correctly dispatch to the
monomorphized fn for the concrete type — getting the
concrete name through the vtable without per-impl boilerplate. Read more§fn cacheable_layout(&self) -> bool
fn cacheable_layout(&self) -> bool
layout_response may be
memoized by the per-pass layout cache. Defaults to true. Read more§fn paint(&self, _bounds: Rect, _canvas: &mut Canvas, _ctx: &PaintContext<'_>)
fn paint(&self, _bounds: Rect, _canvas: &mut Canvas, _ctx: &PaintContext<'_>)
§fn wants_after_paint(&self) -> bool
fn wants_after_paint(&self) -> bool
after_paint
hook to fire each frame. Returning false (the default) saves
a virtual call per widget per frame for the vast majority of
widgets that don’t aggregate descendant geometry. Read more§fn after_paint(&self, _view: &WidgetTreeView<'_>, _ctx: &PaintContext<'_>)
fn after_paint(&self, _view: &WidgetTreeView<'_>, _ctx: &PaintContext<'_>)
TitleBar aggregates its drag region and control-button
rects into a single HitRegions payload for the Windows
backend’s WM_NCHITTEST. Read more§fn wants_post_paint(&self) -> bool
fn wants_post_paint(&self) -> bool
post_paint
hook to fire each frame. Returning false (the default) saves a
virtual call per widget per frame for the vast majority of widgets
that don’t draw a foreground over their children. Read more§fn post_paint(
&self,
_bounds: Rect,
_canvas: &mut Canvas,
_ctx: &PaintContext<'_>,
)
fn post_paint( &self, _bounds: Rect, _canvas: &mut Canvas, _ctx: &PaintContext<'_>, )
§fn wants_descendant_redirects(&self) -> bool
fn wants_descendant_redirects(&self) -> bool
a11y_redirect_descendant
hook for every descendant during AT tree emission, not
just its direct arena children. Read more§fn a11y_redirect_descendant(
&self,
_self_id: WidgetId,
_descendant: WidgetId,
) -> Option<NodeId>
fn a11y_redirect_descendant( &self, _self_id: WidgetId, _descendant: WidgetId, ) -> Option<NodeId>
§fn accessible_title_hint(&self) -> Option<String>
fn accessible_title_hint(&self) -> Option<String>
§fn initial_focus_hint(&self) -> Option<WidgetId>
fn initial_focus_hint(&self) -> Option<WidgetId>
§fn accessibility_children(&self) -> Option<Vec<WidgetId>>
fn accessibility_children(&self) -> Option<Vec<WidgetId>>
§fn clips_children(&self) -> bool
fn clips_children(&self) -> bool
§fn focus_reveal_rect(&self, _bounds: Rect) -> Option<Rect>
fn focus_reveal_rect(&self, _bounds: Rect) -> Option<Rect>
None (the default) reveals the widget’s whole
bounds — correct for most controls. Read more§fn hit_shape(&self, _local_point: Point, _bounds: Rect) -> bool
fn hit_shape(&self, _local_point: Point, _bounds: Rect) -> bool
false for a point that is inside
the bounding box makes the widget transparent to the click there,
so it falls through to whatever sibling is painted underneath
(the same machinery as a fully pass-through node, but shape-aware). Read more§fn preserves_children_on_rebuild(&self) -> bool
fn preserves_children_on_rebuild(&self) -> bool
rebuild_single_widget treats this widget’s existing children
when re-running its build(). Read more§fn tooltip_has_content(&self) -> bool
fn tooltip_has_content(&self) -> bool
§fn declare_shortcuts(&self) -> Vec<Shortcut>
fn declare_shortcuts(&self) -> Vec<Shortcut>
build()) and at certain lazy
boundaries (e.g. Switcher walks declarations on its
not-yet-mounted Pending slots), so settings UIs and the
ShortcutRegistry see the keystrokes the moment the owning
container mounts — even if build() hasn’t run. Read more§fn take_handler_set(&mut self) -> Option<HandlerSet>
fn take_handler_set(&mut self) -> Option<HandlerSet>
WidgetWithHandlers wrapper.
Called during arena insertion to transfer handlers to the WidgetNode.
Default: returns None (no attached handlers).Auto Trait Implementations§
impl !RefUnwindSafe for MenuItem
impl !Send for MenuItem
impl !Sync for MenuItem
impl !UnwindSafe for MenuItem
impl Freeze for MenuItem
impl Unpin for MenuItem
impl UnsafeUnpin for MenuItem
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<W> IntoTeksiChild for Wwhere
W: Widget + 'static,
impl<W> IntoTeksiChild for Wwhere
W: Widget + 'static,
fn into_pending(self) -> PendingChild
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<W> WidgetBuilder for Wwhere
W: Widget + 'static,
impl<W> WidgetBuilder for Wwhere
W: Widget + 'static,
fn on_tap( self, f: impl FnMut(&TapEvent, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_double_tap( self, f: impl FnMut(&TapEvent, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_triple_tap( self, f: impl FnMut(&TapEvent, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_long_press( self, f: impl FnMut(&TapEvent, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
on_tap. Default is [ButtonMask::PRIMARY].on_double_tap. Default [ButtonMask::PRIMARY].on_triple_tap. Default [ButtonMask::PRIMARY].on_long_press. Default [ButtonMask::PRIMARY].§fn dim_when_inactive(self, factor: f32) -> DimWhenInactive
fn dim_when_inactive(self, factor: f32) -> DimWhenInactive
factor opacity whenever the host window
is inactive (not focused / occluded), restoring full opacity when it
becomes active again. The opt-in, per-widget layer of the window-active
appearance model — for custom content an app wants to fade back when its
window isn’t the active one. Stock widgets handle their own
inactive appearance (caret hiding, selection desaturation) and need no
wrapping. Layout- and a11y-transparent; the opacity snaps (no tween),
which is correct under prefers-reduced-motion. See
DimWhenInactive.§fn dim_when_inactive_default(self) -> DimWhenInactive
fn dim_when_inactive_default(self) -> DimWhenInactive
dim_when_inactive with the default factor
(DEFAULT_DIM_FACTOR, 70 %).fn on_drag( self, f: impl FnMut(DragPhase, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_swipe( self, f: impl FnMut(SwipeDirection, f32, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_pinch( self, f: impl FnMut(PinchPhase, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_focus( self, f: impl FnMut(bool, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_key( self, f: impl FnMut(&WidgetEvent, &mut EventContext<'_>) -> EventResponse + 'static, ) -> WidgetWithHandlers<Self>
§fn on_key_preview(
self,
f: impl FnMut(&WidgetEvent, &mut EventContext<'_>) -> EventResponse + 'static,
) -> WidgetWithHandlers<Self>
fn on_key_preview( self, f: impl FnMut(&WidgetEvent, &mut EventContext<'_>) -> EventResponse + 'static, ) -> WidgetWithHandlers<Self>
HandlerSet::on_key_preview].fn on_pointer_event( self, f: impl FnMut(&WidgetEvent, &mut EventContext<'_>) -> EventResponse + 'static, ) -> WidgetWithHandlers<Self>
fn on_hover( self, f: impl FnMut(bool, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_scroll( self, f: impl FnMut(&WidgetEvent, &mut EventContext<'_>) -> EventResponse + 'static, ) -> WidgetWithHandlers<Self>
fn on_access_action( self, f: impl FnMut(Action, &mut EventContext<'_>) -> EventResponse + 'static, ) -> WidgetWithHandlers<Self>
fn focusable(self, focusable: bool) -> WidgetWithHandlers<Self>
fn tab_index(self, index: i32) -> WidgetWithHandlers<Self>
fn cursor(self, cursor: CursorIcon) -> WidgetWithHandlers<Self>
fn clips_children_on(self, clips: bool) -> WidgetWithHandlers<Self>
§fn ime_input(self, ctx: ImeContext) -> WidgetWithHandlers<Self>
fn ime_input(self, ctx: ImeContext) -> WidgetWithHandlers<Self>
ctx’s purpose) while it is focused. See [crate::ime].§fn event_pass_through(self, pass_through: bool) -> WidgetWithHandlers<Self>
fn event_pass_through(self, pass_through: bool) -> WidgetWithHandlers<Self>
HandlerSet::event_pass_through].§fn gesture_dead_zone(self, dead_zone: bool) -> WidgetWithHandlers<Self>
fn gesture_dead_zone(self, dead_zone: bool) -> WidgetWithHandlers<Self>
HandlerSet::gesture_dead_zone].§fn keyboard_capture(self, capture: bool) -> WidgetWithHandlers<Self>
fn keyboard_capture(self, capture: bool) -> WidgetWithHandlers<Self>
KeyDowns bypass shortcut resolution.
See [HandlerSet::keyboard_capture].§fn hit_transparent(self, transparent: bool) -> WidgetWithHandlers<Self>
fn hit_transparent(self, transparent: bool) -> WidgetWithHandlers<Self>
HandlerSet::hit_transparent].HandlerSet::context_menu] for the full contract.§fn focus_within(self, signal: Signal<bool>) -> WidgetWithHandlers<Self>
fn focus_within(self, signal: Signal<bool>) -> WidgetWithHandlers<Self>
Signal<bool> the framework writes when a strict
descendant has focus. See [HandlerSet::focus_within].§fn hover_within(self, signal: Signal<bool>) -> WidgetWithHandlers<Self>
fn hover_within(self, signal: Signal<bool>) -> WidgetWithHandlers<Self>
Signal<bool> the framework writes when a strict
descendant is hovered. See [HandlerSet::hover_within].§fn visible_when(self, state: impl Into<Prop<bool>>) -> WidgetWithHandlers<Self>
fn visible_when(self, state: impl Into<Prop<bool>>) -> WidgetWithHandlers<Self>
bool / Signal<bool> / Prop<bool>) as
a builder property, so teksu! can write visible_when: sig. Equivalent
to ctx.visible_when(id, ..). See [HandlerSet::visible_when].fn on_drag_hover( self, f: impl FnMut(&DragPayload, Point, &mut EventContext<'_>) -> DropFeedback + 'static, ) -> WidgetWithHandlers<Self>
fn on_drag_leave( self, f: impl FnMut(&mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_drag_tick( self, f: impl FnMut(Point, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
fn on_drop( self, f: impl FnMut(DragPayload, Point, &mut EventContext<'_>) -> bool + 'static, ) -> WidgetWithHandlers<Self>
§fn on_drag_ended(
self,
f: impl FnMut(DropOutcome, &mut EventContext<'_>) + 'static,
) -> WidgetWithHandlers<Self>
fn on_drag_ended( self, f: impl FnMut(DropOutcome, &mut EventContext<'_>) + 'static, ) -> WidgetWithHandlers<Self>
HandlerSet::on_drag_ended].