v0.27.4
TabBar joins the dual-channel pattern with SelectionChanged business events; Button and TextInput move their internal handlers off the user GestureHandler slot. ui! on EventKind accepts a callback-form (on Tap(cb) / on Tap(2, cb)) so handlers can stay one line when there's no inline body.
Added
TabBarEvent::SelectionChanged { new: u8, old: u8 }+TabBarHandler— fires fromtabbar_handlerafter a Tap movesselected. Same-tab re-tap doesn't emit. Indicator tween starts from the handler itself;tab_pages_systemkeeps adetect_programmatic_selection_changespass for callers that mutateTabBar.selecteddirectly.ui! { TabBar (...) on SelectionChanged { ... } {} }— handler bodies seenewandoldauto-destructured from the variant. Qualifiedon TabBar::SelectionChangedworks too.- Callback-form
on EventKind(cb)— the trailing arg inon EventKind(args, cb)may be a callable expression instead of a{ ... }body. Combinations:on Tap(cb)(bare callback),on Tap(2, cb)(count=2 callback). Body-form and callback-form coexist on the same widget. gallery/examples/tabbar_selection_demo.rs— typed-widget TabBar with on SelectionChanged callback updating a live label.
Changed
ButtonandTextInputmove toView::with_internal_gesture—button_handlerandtextinput_gesture_handlerno longer install a user-facingGestureHandlercomponent. A user that attaches their ownGestureHandleron these widgets no longer overwrites the press / focus-on-tap behaviour.text_input_attachstill installsFocusableandKeyHandleron the focus channel.- TabBar internal handler moves to
View::with_internal_gesture— same pattern as Slider / Switch / Checkbox / ProgressBar in v0.27.2 / v0.27.3.
Internal
- xrune dependency:
1.5.2(1.5.0 yanked previously).DsOn.bodyisOption<syn::Block>to support callback-form parsing; the macro side handles the optional body.