v0.27.5
mirui::gallery ships behind a new opt-in gallery feature: 40 demo
bodies live as pub fn build_widgets(world, parent) -> Entity plus an
optional setup_app(app, parent) -> Entity that brings the matching
plugins, themes, and SimTimelines. Any backend — desktop SDL, the
Linux fbdev / DRM paths, or the bare-metal ESP32-C3 build — can mount
the same demo widget tree by calling setup_app.
on body return semantics gain explicit shapes through a new
HandlerReturn trait: a body ending in () defaults to Prevent, a
trailing bool keeps the existing convention, and the new
BubbleControl::{Prevent, Allow} enum names the choice. The
underlying handler context aggregates world / entity / event
into a single HandlerCtx<'a, E> so handler bodies access fields
through ctx.world, ctx.entity, ctx.event. on EventKind(cb)
callback-form receives &mut HandlerCtx<E> accordingly.
Added
mirui::gallerymodule +gallerycargo feature — gated re-export of 40 widget-tree demos undermirui::gallery::demos::*. Each demo carries a build_widgets signature usable inno_stdplus asetup_apphelper available underfeature = "std".mirui::event::HandlerCtx<'a, E>— a&mut World,Entity, and&Eaggregate thatonbody and callback handlers receive instead of three separate parameters.mirui::event::HandlerReturntrait — implemented for()(returns Prevent),bool(current Prevent / Allow convention), and the newBubbleControlenum.mirui::event::BubbleControl::{Prevent, Allow}— a named enum foronbody returns; equivalent to returningtrue/falsebut reads at the call site.gallery/examples/backends/andgallery/examples/tools/— backend-specific demos (compose_backend,linux_drm,linux_fb,sdl_gpu,sdl_smoke,wgpu_smoke,compose_backend_dsl) and developer tooling (perf_bench,perf_collect, snapshot regressions,widget_demo,zorder_baseline,hello_sdl,sim_input_demo,layout_demo) move to subdirectories with explicit[[example]]entries ingallery/Cargo.toml.tests/gallery_demos.rs— 38 demos under one aggregate smoke plus dedicatedcustom_view_demo_smokeandwidgets_demo_smokefor the registry-aware and viewport-aware paths.
Changed
onbody context aggregation (BREAKING) —__world,__entity,__eventidentifiers are gone. Handler bodies access state throughctx.world,ctx.entity,ctx.eventinstead.on EventKind(cb)callback-form signature (BREAKING) — callbacks take&mut HandlerCtx<E>and return aHandlerReturn-compatible value, replacing the previous(world, entity, event)triple.gallery/src/demos/directory removed — every demo body that used to live there now resides atmirui::gallery::demos::xxx. Thegallery::runrunner stays ingallery/src/lib.rs; demos are imported from the mirui crate.linux_fb_demoandlinux_drm_demoroute throughmirui::gallery::demos::hello::setup_app.xtask cmd_lint—xrune-fmt --checkwalksgallery/examples/recursively so files underbackends/andtools/stay in the format gate.
Internal
- Demo bodies kept
no_std+alloc-friendly:setup_appiscfg(feature = "std"),build_widgetsis not.widgets::build_widgetstakes(world, parent, view_w, view_h)so the host backend's display size flows through without aSetupparameter. gallery/Cargo.tomlenablesmiruifeatures["quad-aa", "gallery"]so every cargo example sees the demos module.- xrune dependency stays at
1.5.2.