Skip to main content

Module widget_builder

Module widget_builder 

Source
Expand description

WidgetBuilder trait — blanket-implemented for all Widget types.

Provides attached event handler methods and framework-level properties. Each method wraps the widget in a WidgetWithHandlers<W> that stores the handlers and metadata alongside the widget. When the widget is inserted into the arena, the handler set is extracted and applied to the WidgetNode.

The four click-style handlers (on_tap / on_double_tap / on_triple_tap / on_long_press) all receive a borrowed crate::gesture::TapEvent (position + button + modifiers) and default to crate::event::ButtonMask::PRIMARY acceptance. Widen that filter via the matching accept_*_buttons(...) knob — see the “Event System” section in docs/events-and-gestures.md for the full contract and examples.

Structs§

AccessibilityOverrides
Builder-level accessibility overrides.
HandlerSet
Temporary storage for handlers and metadata accumulated via builder methods. Transferred to the WidgetNode during arena insertion.
WidgetWithHandlers
A widget wrapped with attached event handlers and framework metadata. Created by calling builder methods from WidgetBuilder on any widget.

Enums§

AccessSubtreeMode
Subtree visibility / merge mode applied by the accessibility tree walker.

Traits§

WidgetBuilder
Blanket trait providing attached handler methods for all Widget types. The first builder method call wraps the widget in WidgetWithHandlers.

Type Aliases§

ContextMenuFactory
Type alias for a context-menu content factory.