zng/wrap.rs
1#![cfg(feature = "wrap")]
2
3//! Wrap layout widget and properties.
4//!
5//! The [`Wrap!`](struct@Wrap) widget implements [inline layout](crate::layout#inline). The example below demonstrates
6//! a *rich text* composed of multiple `Wrap!` and `Text!` widgets.
7//!
8//! ```
9//! use zng::prelude::*;
10//! # let _scope = APP.defaults();
11//!
12//! # let _ =
13//! Wrap!(ui_vec![
14//! Text!("Some text that "),
15//! text::Strong!("wraps"),
16//! Text!(" together."),
17//! Wrap! {
18//! text::font_color = colors::GREEN;
19//! children = ui_vec![
20//! Text!(" Nested Wrap panels can be used to set "),
21//! text::Em!("contextual"),
22//! Text!(" properties for a sequence of widgets.")
23//! ]
24//! },
25//! Text!(" The nested Wrap panel content items "),
26//! text::Strong!("wrap"),
27//! Text!(" with the parent items."),
28//! ])
29//! # ;
30//! ```
31//!
32//! Note that only some widgets and properties support inline layout, see the [`layout`](crate::layout#inline)
33//! module documentation for more details.
34//!
35//! # Full API
36//!
37//! See [`zng_wgt_wrap`] for the full view API.
38
39pub use zng_wgt_wrap::{
40 WidgetInfoWrapExt, Wrap, get_index, get_index_len, get_rev_index, is_even, is_first, is_last, is_odd, lazy_sample, lazy_size, node,
41};