diff options
Diffstat (limited to 'src/widget/column.rs')
-rw-r--r-- | src/widget/column.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/widget/column.rs b/src/widget/column.rs index 18a68f60..903de897 100644 --- a/src/widget/column.rs +++ b/src/widget/column.rs @@ -5,11 +5,12 @@ use crate::{ Style, Widget, }; -/// A container that places its contents vertically. +/// A container that distributes its contents vertically. /// /// A [`Column`] will try to fill the horizontal space of its container. /// /// [`Column`]: struct.Column.html +#[derive(Default)] pub struct Column<'a, Message, Renderer> { style: Style, spacing: u16, @@ -43,7 +44,7 @@ impl<'a, Message, Renderer> Column<'a, Message, Renderer> { /// Sets the vertical spacing _between_ elements in pixels. /// - /// Custom margins per element do not exist in Coffee. You should use this + /// Custom margins per element do not exist in Iced. You should use this /// method instead! While less flexible, it helps you keep spacing between /// elements consistent. pub fn spacing(mut self, px: u16) -> Self { @@ -121,7 +122,7 @@ impl<'a, Message, Renderer> Column<'a, Message, Renderer> { /// Adds an [`Element`] to the [`Column`]. /// - /// [`Element`]: ../core/struct.Element.html + /// [`Element`]: ../struct.Element.html /// [`Column`]: struct.Column.html pub fn push<E>(mut self, child: E) -> Column<'a, Message, Renderer> where @@ -144,7 +145,7 @@ impl<'a, Message, Renderer> Widget<Message, Renderer> let mut style = node.0.style(); style.margin.bottom = - stretch::style::Dimension::Points(self.spacing as f32); + stretch::style::Dimension::Points(f32::from(self.spacing)); node.0.set_style(style); node @@ -199,12 +200,12 @@ impl<'a, Message, Renderer> Widget<Message, Renderer> cursor } - fn hash(&self, state: &mut Hasher) { + fn hash_layout(&self, state: &mut Hasher) { self.style.hash(state); self.spacing.hash(state); for child in &self.children { - child.widget.hash(state); + child.widget.hash_layout(state); } } } |