From bb898fa2e277d46642feec397efd753f133a0aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 19 Mar 2020 09:37:13 +0100 Subject: [PATCH] Create `PaneGrid` alias in `iced_wgpu` --- src/widget.rs | 7 ++++--- wgpu/src/widget.rs | 3 +++ wgpu/src/widget/pane_grid.rs | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 wgpu/src/widget/pane_grid.rs diff --git a/src/widget.rs b/src/widget.rs index cb099a65..91ea1ed4 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -30,13 +30,14 @@ mod platform { pub use iced_winit::svg::{Handle, Svg}; } - pub use iced_winit::{pane_grid, PaneGrid, Text}; + 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, + pane_grid::PaneGrid, progress_bar::ProgressBar, radio::Radio, + scrollable::Scrollable, slider::Slider, svg::Svg, + text_input::TextInput, }; /// A container that distributes its contents vertically. diff --git a/wgpu/src/widget.rs b/wgpu/src/widget.rs index 73cce7e2..b39f2d91 100644 --- a/wgpu/src/widget.rs +++ b/wgpu/src/widget.rs @@ -10,6 +10,7 @@ pub mod button; pub mod checkbox; pub mod container; +pub mod pane_grid; pub mod progress_bar; pub mod radio; pub mod scrollable; @@ -23,6 +24,8 @@ pub use checkbox::Checkbox; #[doc(no_inline)] pub use container::Container; #[doc(no_inline)] +pub use pane_grid::PaneGrid; +#[doc(no_inline)] pub use progress_bar::ProgressBar; #[doc(no_inline)] pub use radio::Radio; diff --git a/wgpu/src/widget/pane_grid.rs b/wgpu/src/widget/pane_grid.rs new file mode 100644 index 00000000..7bc2f7c5 --- /dev/null +++ b/wgpu/src/widget/pane_grid.rs @@ -0,0 +1,17 @@ +//! Let your users split regions of your application and organize layout dynamically. +//! +//! [![Pane grid - Iced](https://thumbs.gfycat.com/MixedFlatJellyfish-small.gif)](https://gfycat.com/mixedflatjellyfish) +use crate::Renderer; + +pub use iced_native::pane_grid::{ + Axis, Direction, DragEvent, Focus, KeyPressEvent, Pane, ResizeEvent, Split, + State, +}; + +/// A collection of panes distributed using either vertical or horizontal splits +/// to completely fill the space available. +/// +/// [![Pane grid - Iced](https://thumbs.gfycat.com/MixedFlatJellyfish-small.gif)](https://gfycat.com/mixedflatjellyfish) +/// +/// This is an alias of an `iced_native` pane grid with an `iced_wgpu::Renderer`. +pub type PaneGrid<'a, Message> = iced_native::PaneGrid<'a, Message, Renderer>;