summaryrefslogtreecommitdiffstats
path: root/src/widget/row.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/widget/row.rs')
-rw-r--r--src/widget/row.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/widget/row.rs b/src/widget/row.rs
index 9e0f9d4c..7b7033a1 100644
--- a/src/widget/row.rs
+++ b/src/widget/row.rs
@@ -5,11 +5,12 @@ use crate::{
Style, Widget,
};
-/// A container that places its contents horizontally.
+/// A container that distributes its contents horizontally.
///
/// A [`Row`] will try to fill the horizontal space of its container.
///
/// [`Row`]: struct.Row.html
+#[derive(Default)]
pub struct Row<'a, Message, Renderer> {
style: Style,
spacing: u16,
@@ -40,7 +41,7 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> {
/// Sets the horizontal 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 {
@@ -118,7 +119,7 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> {
/// Adds an [`Element`] to the [`Row`].
///
- /// [`Element`]: ../core/struct.Element.html
+ /// [`Element`]: ../struct.Element.html
/// [`Row`]: struct.Row.html
pub fn push<E>(mut self, child: E) -> Row<'a, Message, Renderer>
where
@@ -141,7 +142,7 @@ impl<'a, Message, Renderer> Widget<Message, Renderer>
let mut style = node.0.style();
style.margin.end =
- stretch::style::Dimension::Points(self.spacing as f32);
+ stretch::style::Dimension::Points(f32::from(self.spacing));
node.0.set_style(style);
node
@@ -196,12 +197,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);
}
}
}