From b6926d9ab4ae0c45049c3a8c19616939cbe9db95 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 4 Mar 2020 21:56:59 +0100 Subject: Improve `Debug` implementation of `cache::State` --- wgpu/src/widget/canvas/layer/cache.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'wgpu/src/widget') diff --git a/wgpu/src/widget/canvas/layer/cache.rs b/wgpu/src/widget/canvas/layer/cache.rs index 3071cce0..8f265142 100644 --- a/wgpu/src/widget/canvas/layer/cache.rs +++ b/wgpu/src/widget/canvas/layer/cache.rs @@ -21,7 +21,6 @@ pub struct Cache { state: RefCell, } -#[derive(Debug)] enum State { Empty, Filled { @@ -99,3 +98,17 @@ where mesh } } + +impl std::fmt::Debug for State { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + State::Empty => write!(f, "Empty"), + State::Filled { mesh, bounds } => f + .debug_struct("Filled") + .field("vertices", &mesh.vertices.len()) + .field("indices", &mesh.indices.len()) + .field("bounds", bounds) + .finish(), + } + } +} -- cgit From 4e0e50ae273c24c8cfba7f190c2b69b2f9f91c54 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 10 Mar 2020 06:46:11 +0100 Subject: Fix `Debug` implementation of `layer::cache::State` --- wgpu/src/widget/canvas/layer/cache.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'wgpu/src/widget') diff --git a/wgpu/src/widget/canvas/layer/cache.rs b/wgpu/src/widget/canvas/layer/cache.rs index be08d48d..f7002459 100644 --- a/wgpu/src/widget/canvas/layer/cache.rs +++ b/wgpu/src/widget/canvas/layer/cache.rs @@ -101,10 +101,9 @@ impl std::fmt::Debug for State { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { State::Empty => write!(f, "Empty"), - State::Filled { mesh, bounds } => f + State::Filled { primitive, bounds } => f .debug_struct("Filled") - .field("vertices", &mesh.vertices.len()) - .field("indices", &mesh.indices.len()) + .field("primitive", primitive) .field("bounds", bounds) .finish(), } -- cgit From bb898fa2e277d46642feec397efd753f133a0aae Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 19 Mar 2020 09:37:13 +0100 Subject: Create `PaneGrid` alias in `iced_wgpu` --- wgpu/src/widget/pane_grid.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 wgpu/src/widget/pane_grid.rs (limited to 'wgpu/src/widget') 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>; -- cgit