diff options
author | 2023-02-10 14:46:03 -0800 | |
---|---|---|
committer | 2023-02-16 16:15:45 +0100 | |
commit | d05ac38159dc2828b6e5b0d416802d8ef4be80d2 (patch) | |
tree | b13d070cb136346a837bfdc81ff5984837804ddc /native/src/widget/pane_grid.rs | |
parent | 84a6038961a5ebd1366ae8c6ba9e44be07d37f16 (diff) | |
download | iced-d05ac38159dc2828b6e5b0d416802d8ef4be80d2.tar.gz iced-d05ac38159dc2828b6e5b0d416802d8ef4be80d2.tar.bz2 iced-d05ac38159dc2828b6e5b0d416802d8ef4be80d2.zip |
Revert "provide ID to operation.container in applicable widgets"
This reverts commit 8f9550bcf7c1cebbf90e80683761375406ca6139.
Diffstat (limited to 'native/src/widget/pane_grid.rs')
-rw-r--r-- | native/src/widget/pane_grid.rs | 53 |
1 files changed, 9 insertions, 44 deletions
diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs index 6a65754e..eb04c0ba 100644 --- a/native/src/widget/pane_grid.rs +++ b/native/src/widget/pane_grid.rs @@ -101,7 +101,6 @@ where Renderer: crate::Renderer, Renderer::Theme: StyleSheet + container::StyleSheet, { - id: Option<Id>, contents: Contents<'a, Content<'a, Message, Renderer>>, width: Length, height: Length, @@ -148,7 +147,6 @@ where }; Self { - id: None, contents, width: Length::Fill, height: Length::Fill, @@ -160,12 +158,6 @@ where } } - /// Sets the [`Id`] of the [`PaneGrid`]. - pub fn id(mut self, id: Id) -> Self { - self.id = Some(id); - self - } - /// Sets the width of the [`PaneGrid`]. pub fn width(mut self, width: Length) -> Self { self.width = width; @@ -305,18 +297,15 @@ where renderer: &Renderer, operation: &mut dyn widget::Operation<Message>, ) { - operation.container( - self.id.as_ref().map(|id| &id.0), - &mut |operation| { - self.contents - .iter() - .zip(&mut tree.children) - .zip(layout.children()) - .for_each(|(((_pane, content), state), layout)| { - content.operate(state, layout, renderer, operation); - }) - }, - ); + operation.container(None, &mut |operation| { + self.contents + .iter() + .zip(&mut tree.children) + .zip(layout.children()) + .for_each(|(((_pane, content), state), layout)| { + content.operate(state, layout, renderer, operation); + }) + }); } fn on_event( @@ -1007,27 +996,3 @@ impl<'a, T> Contents<'a, T> { matches!(self, Self::Maximized(..)) } } - -/// The identifier of a [`PaneGrid`]. -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct Id(widget::Id); - -impl Id { - /// Creates a custom [`Id`]. - pub fn new(id: impl Into<std::borrow::Cow<'static, str>>) -> Self { - Self(widget::Id::new(id)) - } - - /// Creates a unique [`Id`]. - /// - /// This function produces a different [`Id`] every time it is called. - pub fn unique() -> Self { - Self(widget::Id::unique()) - } -} - -impl From<Id> for widget::Id { - fn from(id: Id) -> Self { - id.0 - } -} |