From 7479ba137f75a7d3116a4cf244c499d05df4aff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Sun, 5 Apr 2020 04:38:10 +0200 Subject: [PATCH] Document widget feature flags --- src/lib.rs | 1 + src/widget.rs | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index e6e15e95..4f66cc73 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -178,6 +178,7 @@ #![deny(unused_results)] #![forbid(unsafe_code)] #![forbid(rust_2018_idioms)] +#![cfg_attr(docsrs, feature(doc_cfg))] mod application; mod element; mod sandbox; diff --git a/src/widget.rs b/src/widget.rs index 758dc930..03e3192b 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -18,13 +18,22 @@ //! [`text_input::State`]: text_input/struct.State.html #[cfg(not(target_arch = "wasm32"))] mod platform { - pub use iced_wgpu::widget::*; + pub use iced_wgpu::widget::{ + button, checkbox, container, pane_grid, progress_bar, radio, + scrollable, slider, text_input, + }; + #[cfg(feature = "canvas")] + #[cfg_attr(docsrs, doc(cfg(feature = "canvas")))] + pub use iced_wgpu::widget::canvas; + + #[cfg_attr(docsrs, doc(cfg(feature = "image")))] pub mod image { //! Display images in your user interface. pub use iced_winit::image::{Handle, Image}; } + #[cfg_attr(docsrs, doc(cfg(feature = "svg")))] pub mod svg { //! Display vector graphics in your user interface. pub use iced_winit::svg::{Handle, Svg};