smudge_widgets/lib.rs
1//! The core widget set: layout containers, the button, the image, the scroll
2//! view and the virtual list.
3//!
4//! The widgets here are built from the [`Panel`](smudge_core::widget::Panel)
5//! the core provides, the [`Label`](smudge_text::Label) the text crate
6//! provides, and the [`Widget`](smudge_core::widget::Widget) trait directly,
7//! styled with theme tokens by default. A theme switch therefore repaints
8//! what these widgets show without any extra code.
9//!
10//! ```
11//! use smudge_core::geometry::Size;
12//! use smudge_core::style::px;
13//! use smudge_widgets::{ButtonExt, button, column, scroll, spacer};
14//!
15//! let toolbar = column()
16//! .width(px(200.0))
17//! .gap(Size {
18//! width: 8.0,
19//! height: 8.0,
20//! })
21//! .child(button("Save"))
22//! .child(button("Cancel").primary())
23//! .child(spacer())
24//! .child(scroll(column()).height(px(120.0)));
25//! ```
26
27mod button;
28mod containers;
29mod height_index;
30mod image;
31mod scroll;
32mod virtual_list;
33mod virtual_list_keyed;
34
35pub use button::{ButtonExt, button};
36pub use containers::{column, row, spacer, stack};
37pub use image::{ImageView, image};
38pub use scroll::{ScrollExt, ScrollView, scroll};
39pub use virtual_list::virtual_list;
40pub use virtual_list_keyed::virtual_list_keyed;