summaryrefslogtreecommitdiffstats
path: root/src/pure.rs
blob: 712bd31f6574dd58959ba239415245f1bc23a237 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//! Leverage pure, virtual widgets in your application.
//!
//! The widgets found in this module are completely stateless versions of
//! [the original widgets].
//!
//! Effectively, this means that, as a user of the library, you do not need to
//! keep track of the local state of each widget (e.g. [`button::State`]).
//! Instead, the runtime will keep track of everything for you!
//!
//! You can embed pure widgets anywhere in your [impure `Application`] using the
//! [`Pure`] widget and some [`State`].
//!
//! In case you want to only use pure widgets in your application, this module
//! offers an alternate [`Application`] trait with a completely pure `view`
//! method.
//!
//! [the original widgets]: crate::widget
//! [`button::State`]: crate::widget::button::State
//! [impure `Application`]: crate::Application
pub use iced_pure::{Element as _, Image as _, Text as _, *};

/// A generic, pure [`Widget`].
pub type Element<'a, Message> =
    iced_pure::Element<'a, Message, crate::Renderer>;

/// A pure text widget.
pub type Text = iced_pure::Text<crate::Renderer>;

/// A pure image widget.
pub type Image = iced_pure::Image<crate::widget::image::Handle>;

mod application;
mod sandbox;

pub use application::Application;
pub use sandbox::Sandbox;