From 969de1d31ce7c17f297b2b8abffd071caa562646 Mon Sep 17 00:00:00 2001 From: hatoo Date: Wed, 3 Jun 2020 22:01:28 +0900 Subject: Add a comment of how to clear the display to `integration` example --- examples/integration/src/main.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/examples/integration/src/main.rs b/examples/integration/src/main.rs index 6b4aa968..2206d906 100644 --- a/examples/integration/src/main.rs +++ b/examples/integration/src/main.rs @@ -163,6 +163,29 @@ pub fn main() { program.background_color(), ); + // If you are using this example and you have no `scene` on your application, + // you can clear screen by this code. + /* + let _ = + encoder.begin_render_pass(&wgpu::RenderPassDescriptor { + color_attachments: &[ + wgpu::RenderPassColorAttachmentDescriptor { + attachment: &frame.view, + resolve_target: None, + load_op: wgpu::LoadOp::Clear, + store_op: wgpu::StoreOp::Store, + clear_color: wgpu::Color { + r: 1.0, + g: 1.0, + b: 1.0, + a: 1.0, + }, + }, + ], + depth_stencil_attachment: None, + }); + */ + // And then iced on top let mouse_interaction = renderer.backend_mut().draw( &mut device, -- cgit From fd3801ed38a5adbba11ede16f552cd80c0a8bb58 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 5 Jun 2020 15:05:30 +0200 Subject: Clear frames explicitly in `integration` example --- examples/integration/src/main.rs | 38 +++++++-------------------- examples/integration/src/scene.rs | 55 +++++++++++++++++++-------------------- 2 files changed, 37 insertions(+), 56 deletions(-) diff --git a/examples/integration/src/main.rs b/examples/integration/src/main.rs index 2206d906..db8b4366 100644 --- a/examples/integration/src/main.rs +++ b/examples/integration/src/main.rs @@ -154,37 +154,19 @@ pub fn main() { &wgpu::CommandEncoderDescriptor { label: None }, ); - // We draw the scene first let program = state.program(); - scene.draw( - &mut encoder, - &frame.view, - program.background_color(), - ); + { + // We clear the frame + let mut render_pass = scene.clear( + &frame.view, + &mut encoder, + program.background_color(), + ); - // If you are using this example and you have no `scene` on your application, - // you can clear screen by this code. - /* - let _ = - encoder.begin_render_pass(&wgpu::RenderPassDescriptor { - color_attachments: &[ - wgpu::RenderPassColorAttachmentDescriptor { - attachment: &frame.view, - resolve_target: None, - load_op: wgpu::LoadOp::Clear, - store_op: wgpu::StoreOp::Store, - clear_color: wgpu::Color { - r: 1.0, - g: 1.0, - b: 1.0, - a: 1.0, - }, - }, - ], - depth_stencil_attachment: None, - }); - */ + // Draw the scene + scene.draw(&mut render_pass); + } // And then iced on top let mouse_interaction = renderer.backend_mut().draw( diff --git a/examples/integration/src/scene.rs b/examples/integration/src/scene.rs index b79a7ff4..6c1a4581 100644 --- a/examples/integration/src/scene.rs +++ b/examples/integration/src/scene.rs @@ -16,38 +16,37 @@ impl Scene { } } - pub fn draw( + pub fn clear<'a>( &self, - encoder: &mut wgpu::CommandEncoder, - target: &wgpu::TextureView, + target: &'a wgpu::TextureView, + encoder: &'a mut wgpu::CommandEncoder, background_color: Color, - ) { - let mut rpass = - encoder.begin_render_pass(&wgpu::RenderPassDescriptor { - color_attachments: &[ - wgpu::RenderPassColorAttachmentDescriptor { - attachment: target, - resolve_target: None, - load_op: wgpu::LoadOp::Clear, - store_op: wgpu::StoreOp::Store, - clear_color: { - let [r, g, b, a] = background_color.into_linear(); + ) -> wgpu::RenderPass<'a> { + encoder.begin_render_pass(&wgpu::RenderPassDescriptor { + color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor { + attachment: target, + resolve_target: None, + load_op: wgpu::LoadOp::Clear, + store_op: wgpu::StoreOp::Store, + clear_color: { + let [r, g, b, a] = background_color.into_linear(); - wgpu::Color { - r: r as f64, - g: g as f64, - b: b as f64, - a: a as f64, - } - }, - }, - ], - depth_stencil_attachment: None, - }); + wgpu::Color { + r: r as f64, + g: g as f64, + b: b as f64, + a: a as f64, + } + }, + }], + depth_stencil_attachment: None, + }) + } - rpass.set_pipeline(&self.pipeline); - rpass.set_bind_group(0, &self.bind_group, &[]); - rpass.draw(0..3, 0..1); + pub fn draw<'a>(&'a self, render_pass: &mut wgpu::RenderPass<'a>) { + render_pass.set_pipeline(&self.pipeline); + render_pass.set_bind_group(0, &self.bind_group, &[]); + render_pass.draw(0..3, 0..1); } } -- cgit From 9e01adc964a5b19c5f78877cbeeb331c722b1ca7 Mon Sep 17 00:00:00 2001 From: Voker57 Date: Mon, 8 Jun 2020 11:14:40 +0300 Subject: Replace leftover docs in progress bar module (#396) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Replace leftover docs in progress bar module * Fix consistency of `ProgressBar` docs Co-authored-by: Héctor Ramón Jiménez --- glow/src/widget/progress_bar.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glow/src/widget/progress_bar.rs b/glow/src/widget/progress_bar.rs index 5782103c..a636a3a6 100644 --- a/glow/src/widget/progress_bar.rs +++ b/glow/src/widget/progress_bar.rs @@ -1,9 +1,9 @@ -//! Allow your users to perform actions by pressing a button. +//! Allow your users to visually track the progress of a computation. //! -//! A [`Button`] has some local [`State`]. +//! A [`ProgressBar`] has a range of possible values and a current value, +//! as well as a length, height and style. //! -//! [`Button`]: type.Button.html -//! [`State`]: struct.State.html +//! [`ProgressBar`]: type.ProgressBar.html use crate::Renderer; pub use iced_graphics::progress_bar::{Style, StyleSheet}; -- cgit From 40750d9b36286056508e340ad14ac77c432366ee Mon Sep 17 00:00:00 2001 From: Richard <30560559+derezzedex@users.noreply.github.com> Date: Mon, 8 Jun 2020 06:03:34 -0300 Subject: Removed empty bind group from integration example (#390) --- examples/integration/src/scene.rs | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/examples/integration/src/scene.rs b/examples/integration/src/scene.rs index 6c1a4581..74cbb925 100644 --- a/examples/integration/src/scene.rs +++ b/examples/integration/src/scene.rs @@ -3,17 +3,13 @@ use iced_winit::Color; pub struct Scene { pipeline: wgpu::RenderPipeline, - bind_group: wgpu::BindGroup, } impl Scene { pub fn new(device: &wgpu::Device) -> Scene { - let (pipeline, bind_group) = build_pipeline(device); + let pipeline = build_pipeline(device); - Scene { - pipeline, - bind_group, - } + Scene { pipeline } } pub fn clear<'a>( @@ -45,14 +41,11 @@ impl Scene { pub fn draw<'a>(&'a self, render_pass: &mut wgpu::RenderPass<'a>) { render_pass.set_pipeline(&self.pipeline); - render_pass.set_bind_group(0, &self.bind_group, &[]); render_pass.draw(0..3, 0..1); } } -fn build_pipeline( - device: &wgpu::Device, -) -> (wgpu::RenderPipeline, wgpu::BindGroup) { +fn build_pipeline(device: &wgpu::Device) -> wgpu::RenderPipeline { let vs = include_bytes!("shader/vert.spv"); let fs = include_bytes!("shader/frag.spv"); @@ -64,21 +57,9 @@ fn build_pipeline( &wgpu::read_spirv(std::io::Cursor::new(&fs[..])).unwrap(), ); - let bind_group_layout = - device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { - label: None, - bindings: &[], - }); - - let bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor { - label: None, - layout: &bind_group_layout, - bindings: &[], - }); - let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { - bind_group_layouts: &[&bind_group_layout], + bind_group_layouts: &[], }); let pipeline = @@ -116,5 +97,5 @@ fn build_pipeline( alpha_to_coverage_enabled: false, }); - (pipeline, bind_group) + pipeline } -- cgit From 4960a8827e46cafca672ed7c4550086a9c6029bc Mon Sep 17 00:00:00 2001 From: Duncan Freeman Date: Mon, 8 Jun 2020 02:07:45 -0700 Subject: Add on_release message to Slider (#378) * Add on_finish callback to Slider * Fix formatting * Rename Slider's on_finish to on_release, make the message simply an event without data * Satisfy Clone impl requirement on Message in integration test * Only call on_release after dragging a slider --- examples/integration/src/controls.rs | 2 +- native/src/widget/slider.rs | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/examples/integration/src/controls.rs b/examples/integration/src/controls.rs index 81c35072..e6e74995 100644 --- a/examples/integration/src/controls.rs +++ b/examples/integration/src/controls.rs @@ -9,7 +9,7 @@ pub struct Controls { sliders: [slider::State; 3], } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum Message { BackgroundColorChanged(Color), } diff --git a/native/src/widget/slider.rs b/native/src/widget/slider.rs index 8cdfc3de..753a49fe 100644 --- a/native/src/widget/slider.rs +++ b/native/src/widget/slider.rs @@ -40,6 +40,7 @@ pub struct Slider<'a, Message, Renderer: self::Renderer> { range: RangeInclusive, value: f32, on_change: Box Message>, + on_release: Option, width: Length, style: Renderer::Style, } @@ -71,11 +72,25 @@ impl<'a, Message, Renderer: self::Renderer> Slider<'a, Message, Renderer> { value: value.max(*range.start()).min(*range.end()), range, on_change: Box::new(on_change), + on_release: None, width: Length::Fill, style: Renderer::Style::default(), } } + /// Sets the release message of the [`Slider`]. + /// This is called when the mouse is released from the slider. + /// + /// Typically, the user's interaction with the slider is finished when this message is produced. + /// This is useful if you need to spawn a long-running task from the slider's result, where + /// the default on_change message could create too many events. + /// + /// [`Slider`]: struct.Slider.html + pub fn on_release(mut self, on_release: Message) -> Self { + self.on_release = Some(on_release); + self + } + /// Sets the width of the [`Slider`]. /// /// [`Slider`]: struct.Slider.html @@ -114,6 +129,7 @@ impl<'a, Message, Renderer> Widget for Slider<'a, Message, Renderer> where Renderer: self::Renderer, + Message: Clone, { fn width(&self) -> Length { self.width @@ -171,7 +187,12 @@ where } } mouse::Event::ButtonReleased(mouse::Button::Left) => { - self.state.is_dragging = false; + if self.state.is_dragging { + if let Some(on_release) = self.on_release.clone() { + messages.push(on_release); + } + self.state.is_dragging = false; + } } mouse::Event::CursorMoved { .. } => { if self.state.is_dragging { @@ -252,7 +273,7 @@ impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> where Renderer: 'a + self::Renderer, - Message: 'a, + Message: 'a + Clone, { fn from( slider: Slider<'a, Message, Renderer>, -- cgit From 041cab0fa499a54d21d2742ba821583f55b2a8fc Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 8 Jun 2020 18:11:29 +0200 Subject: Resize `PaneGrid` without modifier keys --- native/src/widget/pane_grid.rs | 213 +++++++++++++++++++---------------- native/src/widget/pane_grid/axis.rs | 24 ++++ native/src/widget/pane_grid/state.rs | 3 + 3 files changed, 141 insertions(+), 99 deletions(-) diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs index 076ae76f..c7467962 100644 --- a/native/src/widget/pane_grid.rs +++ b/native/src/widget/pane_grid.rs @@ -26,7 +26,7 @@ pub use state::{Focus, State}; use crate::{ keyboard, layout, mouse, Clipboard, Element, Event, Hasher, Layout, Length, - Point, Size, Widget, + Point, Rectangle, Size, Widget, }; /// A collection of panes distributed using either vertical or horizontal splits @@ -177,8 +177,8 @@ impl<'a, Message, Renderer> PaneGrid<'a, Message, Renderer> { /// Sets the modifier keys of the [`PaneGrid`]. /// - /// The modifier keys will need to be pressed to trigger dragging, resizing, - /// and key events. + /// The modifier keys will need to be pressed to trigger dragging, and key + /// events. /// /// The default modifier key is `Ctrl`. /// @@ -208,8 +208,6 @@ impl<'a, Message, Renderer> PaneGrid<'a, Message, Renderer> { /// Enables the resize interactions of the [`PaneGrid`], which will /// use the provided function to produce messages. /// - /// Panes can be resized using `Modifier keys + Right click`. - /// /// [`PaneGrid`]: struct.PaneGrid.html pub fn on_resize(mut self, f: F) -> Self where @@ -244,6 +242,35 @@ impl<'a, Message, Renderer> PaneGrid<'a, Message, Renderer> { self } + fn click_pane( + &mut self, + layout: Layout<'_>, + cursor_position: Point, + messages: &mut Vec, + ) { + let mut clicked_region = + self.elements.iter().zip(layout.children()).filter( + |(_, layout)| layout.bounds().contains(cursor_position), + ); + + if let Some(((pane, _), _)) = clicked_region.next() { + match &self.on_drag { + Some(on_drag) + if self.pressed_modifiers.matches(self.modifier_keys) => + { + self.state.pick_pane(pane); + + messages.push(on_drag(DragEvent::Picked { pane: *pane })); + } + _ => { + self.state.focus(pane); + } + } + } else { + self.state.unfocus(); + } + } + fn trigger_resize( &mut self, layout: Layout<'_>, @@ -409,32 +436,45 @@ where match event { Event::Mouse(mouse_event) => match mouse_event { mouse::Event::ButtonPressed(mouse::Button::Left) => { - let mut clicked_region = - self.elements.iter().zip(layout.children()).filter( - |(_, layout)| { - layout.bounds().contains(cursor_position) - }, - ); - - if let Some(((pane, _), _)) = clicked_region.next() { - match &self.on_drag { - Some(on_drag) - if self - .pressed_modifiers - .matches(self.modifier_keys) => - { - self.state.pick_pane(pane); - - messages.push(on_drag(DragEvent::Picked { - pane: *pane, - })); + let bounds = layout.bounds(); + + if bounds.contains(cursor_position) { + match self.on_resize { + Some(_) => { + let relative_cursor = Point::new( + cursor_position.x - bounds.x, + cursor_position.y - bounds.y, + ); + + let splits = self.state.splits( + f32::from(self.spacing), + Size::new(bounds.width, bounds.height), + ); + + let clicked_split = hovered_split( + splits.iter(), + f32::from(self.spacing), + relative_cursor, + ); + + if let Some((split, axis)) = clicked_split { + self.state.pick_split(&split, axis); + } else { + self.click_pane( + layout, + cursor_position, + messages, + ); + } } - _ => { - self.state.focus(pane); + None => { + self.click_pane( + layout, + cursor_position, + messages, + ); } } - } else { - self.state.unfocus(); } } mouse::Event::ButtonReleased(mouse::Button::Left) => { @@ -462,78 +502,10 @@ where messages.push(on_drag(event)); } + } else if self.state.picked_split().is_some() { + self.state.drop_split(); } } - mouse::Event::ButtonPressed(mouse::Button::Right) - if self.on_resize.is_some() - && self.state.picked_pane().is_none() - && self - .pressed_modifiers - .matches(self.modifier_keys) => - { - let bounds = layout.bounds(); - - if bounds.contains(cursor_position) { - let relative_cursor = Point::new( - cursor_position.x - bounds.x, - cursor_position.y - bounds.y, - ); - - let splits = self.state.splits( - f32::from(self.spacing), - Size::new(bounds.width, bounds.height), - ); - - let mut sorted_splits: Vec<_> = splits - .iter() - .filter(|(_, (axis, rectangle, _))| match axis { - Axis::Horizontal => { - relative_cursor.x > rectangle.x - && relative_cursor.x - < rectangle.x + rectangle.width - } - Axis::Vertical => { - relative_cursor.y > rectangle.y - && relative_cursor.y - < rectangle.y + rectangle.height - } - }) - .collect(); - - sorted_splits.sort_by_key( - |(_, (axis, rectangle, ratio))| { - let distance = match axis { - Axis::Horizontal => (relative_cursor.y - - (rectangle.y - + rectangle.height * ratio)) - .abs(), - Axis::Vertical => (relative_cursor.x - - (rectangle.x - + rectangle.width * ratio)) - .abs(), - }; - - distance.round() as u32 - }, - ); - - if let Some((split, (axis, _, _))) = - sorted_splits.first() - { - self.state.pick_split(split, *axis); - self.trigger_resize( - layout, - cursor_position, - messages, - ); - } - } - } - mouse::Event::ButtonReleased(mouse::Button::Right) - if self.state.picked_split().is_some() => - { - self.state.drop_split(); - } mouse::Event::CursorMoved { .. } => { self.trigger_resize(layout, cursor_position, messages); } @@ -597,11 +569,32 @@ where layout: Layout<'_>, cursor_position: Point, ) -> Renderer::Output { + let picked_split = self + .state + .picked_split() + .or_else(|| match self.on_resize { + Some(_) => { + let bounds = layout.bounds(); + let spacing = f32::from(self.spacing); + + let relative_cursor = Point::new( + cursor_position.x - bounds.x, + cursor_position.y - bounds.y, + ); + + let splits = self.state.splits(spacing, bounds.size()); + + hovered_split(splits.iter(), spacing, relative_cursor) + } + None => None, + }) + .map(|(_, axis)| axis); + renderer.draw( defaults, &self.elements, self.state.picked_pane(), - self.state.picked_split().map(|(_, axis)| axis), + picked_split, layout, cursor_position, ) @@ -665,3 +658,25 @@ where Element::new(pane_grid) } } + +/* + * Helpers + */ +fn hovered_split<'a>( + splits: impl Iterator, + spacing: f32, + cursor_position: Point, +) -> Option<(Split, Axis)> { + splits + .filter_map(|(split, (axis, region, ratio))| { + let bounds = + axis.split_line_bounds(*region, *ratio, f32::from(spacing)); + + if bounds.contains(cursor_position) { + Some((*split, *axis)) + } else { + None + } + }) + .next() +} diff --git a/native/src/widget/pane_grid/axis.rs b/native/src/widget/pane_grid/axis.rs index b3a306d5..2320cb7c 100644 --- a/native/src/widget/pane_grid/axis.rs +++ b/native/src/widget/pane_grid/axis.rs @@ -53,6 +53,30 @@ impl Axis { } } } + + pub(super) fn split_line_bounds( + &self, + rectangle: Rectangle, + ratio: f32, + spacing: f32, + ) -> Rectangle { + match self { + Axis::Horizontal => Rectangle { + x: rectangle.x, + y: (rectangle.y + rectangle.height * ratio - spacing / 2.0) + .round(), + width: rectangle.width, + height: spacing, + }, + Axis::Vertical => Rectangle { + x: (rectangle.x + rectangle.width * ratio - spacing / 2.0) + .round(), + y: rectangle.y, + width: spacing, + height: rectangle.height, + }, + } + } } #[cfg(test)] diff --git a/native/src/widget/pane_grid/state.rs b/native/src/widget/pane_grid/state.rs index 4b13fb8e..7a53d6c7 100644 --- a/native/src/widget/pane_grid/state.rs +++ b/native/src/widget/pane_grid/state.rs @@ -4,6 +4,7 @@ use crate::{ Hasher, Point, Rectangle, Size, }; +use std::cell::RefCell; use std::collections::HashMap; /// The state of a [`PaneGrid`]. @@ -71,6 +72,7 @@ impl State { internal: Internal { layout, last_id, + split_cache: RefCell::new(None), action: Action::Idle { focus: None }, }, modifiers: keyboard::ModifiersState::default(), @@ -308,6 +310,7 @@ pub struct Internal { layout: Node, last_id: usize, action: Action, + split_cache: RefCell>>, } #[derive(Debug, Clone, Copy, PartialEq, Eq)] -- cgit From be0cc2c780256ba776e52e0dd14f384553d6a332 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 8 Jun 2020 18:25:23 +0200 Subject: Add `leeway` support to `PaneGrid::on_resize` --- examples/pane_grid/src/main.rs | 2 +- native/src/widget/pane_grid.rs | 28 ++++++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index b4bbd68f..a821072f 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -103,7 +103,7 @@ impl Sandbox for Example { .height(Length::Fill) .spacing(10) .on_drag(Message::Dragged) - .on_resize(Message::Resized) + .on_resize(10, Message::Resized) .on_key_press(handle_hotkey); Container::new(pane_grid) diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs index c7467962..c114fa13 100644 --- a/native/src/widget/pane_grid.rs +++ b/native/src/widget/pane_grid.rs @@ -91,7 +91,7 @@ pub struct PaneGrid<'a, Message, Renderer> { spacing: u16, modifier_keys: keyboard::ModifiersState, on_drag: Option Message + 'a>>, - on_resize: Option Message + 'a>>, + on_resize: Option<(u16, Box Message + 'a>)>, on_key_press: Option Option + 'a>>, } @@ -208,12 +208,15 @@ impl<'a, Message, Renderer> PaneGrid<'a, Message, Renderer> { /// Enables the resize interactions of the [`PaneGrid`], which will /// use the provided function to produce messages. /// + /// The `leeway` describes the amount of space around a split that can be + /// used to grab it. + /// /// [`PaneGrid`]: struct.PaneGrid.html - pub fn on_resize(mut self, f: F) -> Self + pub fn on_resize(mut self, leeway: u16, f: F) -> Self where F: 'a + Fn(ResizeEvent) -> Message, { - self.on_resize = Some(Box::new(f)); + self.on_resize = Some((leeway, Box::new(f))); self } @@ -277,7 +280,7 @@ impl<'a, Message, Renderer> PaneGrid<'a, Message, Renderer> { cursor_position: Point, messages: &mut Vec, ) { - if let Some(on_resize) = &self.on_resize { + if let Some((_, on_resize)) = &self.on_resize { if let Some((split, _)) = self.state.picked_split() { let bounds = layout.bounds(); @@ -440,7 +443,7 @@ where if bounds.contains(cursor_position) { match self.on_resize { - Some(_) => { + Some((leeway, _)) => { let relative_cursor = Point::new( cursor_position.x - bounds.x, cursor_position.y - bounds.y, @@ -453,7 +456,7 @@ where let clicked_split = hovered_split( splits.iter(), - f32::from(self.spacing), + f32::from(self.spacing + leeway), relative_cursor, ); @@ -573,18 +576,23 @@ where .state .picked_split() .or_else(|| match self.on_resize { - Some(_) => { + Some((leeway, _)) => { let bounds = layout.bounds(); - let spacing = f32::from(self.spacing); let relative_cursor = Point::new( cursor_position.x - bounds.x, cursor_position.y - bounds.y, ); - let splits = self.state.splits(spacing, bounds.size()); + let splits = self + .state + .splits(f32::from(self.spacing), bounds.size()); - hovered_split(splits.iter(), spacing, relative_cursor) + hovered_split( + splits.iter(), + f32::from(self.spacing + leeway), + relative_cursor, + ) } None => None, }) -- cgit From dcc4bb77e942f8550b0d7ee08fa5a2882fd22ecd Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 8 Jun 2020 18:25:46 +0200 Subject: Remove unused `split_cache` in `pane_grid` --- native/src/widget/pane_grid/state.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/native/src/widget/pane_grid/state.rs b/native/src/widget/pane_grid/state.rs index 7a53d6c7..4b13fb8e 100644 --- a/native/src/widget/pane_grid/state.rs +++ b/native/src/widget/pane_grid/state.rs @@ -4,7 +4,6 @@ use crate::{ Hasher, Point, Rectangle, Size, }; -use std::cell::RefCell; use std::collections::HashMap; /// The state of a [`PaneGrid`]. @@ -72,7 +71,6 @@ impl State { internal: Internal { layout, last_id, - split_cache: RefCell::new(None), action: Action::Idle { focus: None }, }, modifiers: keyboard::ModifiersState::default(), @@ -310,7 +308,6 @@ pub struct Internal { layout: Node, last_id: usize, action: Action, - split_cache: RefCell>>, } #[derive(Debug, Clone, Copy, PartialEq, Eq)] -- cgit