Expand description
Wrap layout widget and properties.
The Wrap! widget implements inline layout. The example below demonstrates
a rich text composed of multiple Wrap! and Text! widgets.
use zng::prelude::*;
Wrap!(ui_vec![
Text!("Some text that "),
text::Strong!("wraps"),
Text!(" together."),
Wrap! {
text::font_color = colors::GREEN;
children = ui_vec![
Text!(" Nested Wrap panels can be used to set "),
text::Em!("contextual"),
Text!(" properties for a sequence of widgets.")
];
},
Text!(" The nested Wrap panel content items "),
text::Strong!("wrap"),
Text!(" with the parent items."),
])Note that only some widgets and properties support inline layout, see the layout
module documentation for more details.
§Full API
See zng_wgt_wrap for the full view API.
Structs§
- Wrap
WWrapping inline layout.
Traits§
- Widget
Info Wrap Ext - Extension methods for
WidgetInfothat may represent aWrap!instance.
Functions§
- get_
index PGet the child index in the parent wrap.- get_
index_ len PGet the child index and number of children.- get_
rev_ index PGet the child index, starting from the last child at0.- is_even
PIf the child index is even.- is_
first PIf the child is the first.- is_last
PIf the child is the last.- is_odd
PIf the child index is odd.- lazy_
sample - Create a node that estimates the size of wrap panel children.
- lazy_
size - Create a node that estimates the size of wrap panel children.
- node
- Wrap node.