summaryrefslogtreecommitdiffstats
path: root/native/src/widget/container.rs
diff options
context:
space:
mode:
authorLibravatar Nick Senger <dev@nsenger.com>2023-02-10 14:46:03 -0800
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-16 16:15:45 +0100
commitd05ac38159dc2828b6e5b0d416802d8ef4be80d2 (patch)
treeb13d070cb136346a837bfdc81ff5984837804ddc /native/src/widget/container.rs
parent84a6038961a5ebd1366ae8c6ba9e44be07d37f16 (diff)
downloadiced-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/container.rs')
-rw-r--r--native/src/widget/container.rs53
1 files changed, 9 insertions, 44 deletions
diff --git a/native/src/widget/container.rs b/native/src/widget/container.rs
index c82b8be2..cdf1c859 100644
--- a/native/src/widget/container.rs
+++ b/native/src/widget/container.rs
@@ -5,7 +5,7 @@ use crate::layout;
use crate::mouse;
use crate::overlay;
use crate::renderer;
-use crate::widget::{self, Operation, Tree};
+use crate::widget::{Operation, Tree};
use crate::{
Background, Clipboard, Color, Element, Layout, Length, Padding, Point,
Rectangle, Shell, Widget,
@@ -24,7 +24,6 @@ where
Renderer: crate::Renderer,
Renderer::Theme: StyleSheet,
{
- id: Option<Id>,
padding: Padding,
width: Length,
height: Length,
@@ -47,7 +46,6 @@ where
T: Into<Element<'a, Message, Renderer>>,
{
Container {
- id: None,
padding: Padding::ZERO,
width: Length::Shrink,
height: Length::Shrink,
@@ -60,12 +58,6 @@ where
}
}
- /// Sets the [`Id`] of the [`Container`].
- pub fn id(mut self, id: Id) -> Self {
- self.id = Some(id);
- self
- }
-
/// Sets the [`Padding`] of the [`Container`].
pub fn padding<P: Into<Padding>>(mut self, padding: P) -> Self {
self.padding = padding.into();
@@ -180,17 +172,14 @@ where
renderer: &Renderer,
operation: &mut dyn Operation<Message>,
) {
- operation.container(
- self.id.as_ref().map(|id| &id.0),
- &mut |operation| {
- self.content.as_widget().operate(
- &mut tree.children[0],
- layout.children().next().unwrap(),
- renderer,
- operation,
- );
- },
- );
+ operation.container(None, &mut |operation| {
+ self.content.as_widget().operate(
+ &mut tree.children[0],
+ layout.children().next().unwrap(),
+ renderer,
+ operation,
+ );
+ });
}
fn on_event(
@@ -344,27 +333,3 @@ pub fn draw_background<Renderer>(
);
}
}
-
-/// The identifier of a [`Container`].
-#[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
- }
-}