Initial PR in review
InlineBox and InlineImage #25710
This implements a bevy_text API using an InlineBox component that can be used to reserve space in text layouts for inline content. Also includes a limited inline image widget, InlineImage.
InlineBox improvements
InlineImage improvements
Other InlineBox widgets
More complex widgets should probably be implemented as inline UI nodes. But each inline UI node would require creating a new layout context, which could be too heavy and expensive for more trivial widgets.
bevy_ui features
Advanced (probably best left to third party crates)
Initial PR in review
InlineBoxandInlineImage#25710This implements a
bevy_textAPI using anInlineBoxcomponent that can be used to reserve space in text layouts for inline content. Also includes a limited inline image widget,InlineImage.InlineBoximprovementsInlineBoxKind::CustomOutOfFlowsupport. LikeOutOfFlow,CustomOutOfFlowboxes don't take space in the layout, but also their positions are not determined by Parley either, which yields back control to the caller to determine where the box should be placed.vertical-alignsupport in review: Implement thevertical-alignstyle linebender/parley#766.InlineBox. Could be tricky, might need some sort of newInlineTransformcomponent.OutOfFlowboxes can be used to target a specific position in the text to attach a tooltip or popover.InlineImageimprovementsinline_imageexample. Probably better done last, once there's something to show off.Other
InlineBoxwidgetsMore complex widgets should probably be implemented as inline UI nodes. But each inline UI node would require creating a new layout context, which could be too heavy and expensive for more trivial widgets.
InlineBoxcan be used by itself for this, but it isn't ideal as it doesn't support responsive values.bevy_textalready supports unicode emojis.bevy_uifeaturesEntity, (With<Node>, With<InlineBox>)and make each entity a new layout root with an implicit viewport the size of theInlineBox. This will have to wait until Incremental UI updates #25653 lands though.Advanced (probably best left to third party crates)