diff options
author | 2020-01-20 05:43:09 +0100 | |
---|---|---|
committer | 2020-01-20 05:43:09 +0100 | |
commit | 04086a90c9e933ebfb42de378054e1115b33529d (patch) | |
tree | f0a9e25216807f9a20d757eadf420456d16f613f /src/widget.rs | |
parent | 90690702e1e4abab804ec91e8ff4183824bec436 (diff) | |
download | iced-04086a90c9e933ebfb42de378054e1115b33529d.tar.gz iced-04086a90c9e933ebfb42de378054e1115b33529d.tar.bz2 iced-04086a90c9e933ebfb42de378054e1115b33529d.zip |
Implement `WasmBindgen` executor and reorganize
Diffstat (limited to 'src/widget.rs')
-rw-r--r-- | src/widget.rs | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/widget.rs b/src/widget.rs new file mode 100644 index 00000000..7d3a1cef --- /dev/null +++ b/src/widget.rs @@ -0,0 +1,60 @@ +//! Display information and interactive controls in your application. +//! +//! # Re-exports +//! For convenience, the contents of this module are available at the root +//! module. Therefore, you can directly type: +//! +//! ``` +//! use iced::{button, Button}; +//! ``` +//! +//! # Stateful widgets +//! Some widgets need to keep track of __local state__. +//! +//! These widgets have their own module with a `State` type. For instance, a +//! [`TextInput`] has some [`text_input::State`]. +//! +//! [`TextInput`]: text_input/struct.TextInput.html +//! [`text_input::State`]: text_input/struct.State.html +#[cfg(not(target_arch = "wasm32"))] +mod platform { + pub use iced_wgpu::widget::*; + + pub mod image { + //! Display images in your user interface. + pub use iced_winit::image::{Handle, Image}; + } + + pub mod svg { + //! Display vector graphics in your user interface. + pub use iced_winit::svg::{Handle, Svg}; + } + + pub use iced_winit::Text; + + #[doc(no_inline)] + pub use { + button::Button, checkbox::Checkbox, container::Container, image::Image, + progress_bar::ProgressBar, radio::Radio, scrollable::Scrollable, + slider::Slider, svg::Svg, text_input::TextInput, + }; + + /// A container that distributes its contents vertically. + /// + /// This is an alias of an `iced_native` column with a default `Renderer`. + pub type Column<'a, Message> = + iced_winit::Column<'a, Message, iced_wgpu::Renderer>; + + /// A container that distributes its contents horizontally. + /// + /// This is an alias of an `iced_native` row with a default `Renderer`. + pub type Row<'a, Message> = + iced_winit::Row<'a, Message, iced_wgpu::Renderer>; +} + +#[cfg(target_arch = "wasm32")] +mod platform { + pub use iced_web::widget::*; +} + +pub use platform::*; |