v0.27.2
Slider gets a business-event channel: on ValueChanged { ... },
on DragStarted { ... }, on DragEnded { ... } route through the new
SliderHandler instead of GestureHandler. A user-attached
GestureHandler on the same Slider entity no longer replaces the
slider's internal drag/tap behaviour, thanks to a dual-channel
bubble_dispatch.
Added
View::with_internal_gesture(fn)— register a component-internal gesture handler.bubble_dispatch_atwalks each entity through the View-registered internal channel first, then the userGestureHandler. Internal handlers that returntrueconsume the event;falselets the user handler on the same entity also see it.SliderEventenum —ValueChanged { new, old },DragStarted,DragEnded. Bound to theSliderHandlercomponent.SliderHandler { on_event: fn(&mut World, Entity, &SliderEvent) -> bool }— user-attached component that receives slider business events.ui! { Slider (...) on ValueChanged { ... } {} }— handler bodies seenewandoldauto-destructured from the variant.on Slider::ValueChangedqualified form is also accepted.gallery/examples/slider_value_changed_demo.rs— typed-widget Slider with all three business events wired to a label that reports the live value, change count, and drag transitions.
Changed
Sliderno longer attaches aGestureHandler—slider_handlerlives on the View's internal gesture channel. A user that previously attached aGestureHandleron a Slider entity to override the drag behaviour will see both run now (internal first; user handler only fires if internal returnsfalse). Theslider_attachfn is kept as a placeholder for future motion seeding.mirui-macroswidget+EventKind table —FIRST_PARTY_BUSINESS_EVENTSregisters(widget, event)pairs that routeon EventKindclauses to a business handler. Slider's three events populate the table; the dispatch fn synthesis splits handlers across the gesture channel and the business channel.