summaryrefslogtreecommitdiffstats
path: root/native/src/widget/button.rs
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/widget/button.rs')
-rw-r--r--native/src/widget/button.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/native/src/widget/button.rs b/native/src/widget/button.rs
index b4276317..39387173 100644
--- a/native/src/widget/button.rs
+++ b/native/src/widget/button.rs
@@ -76,20 +76,20 @@ where
on_press: None,
width: Length::Shrink,
height: Length::Shrink,
- padding: Padding::new(5),
+ padding: Padding::new(5.0),
style: <Renderer::Theme as StyleSheet>::Style::default(),
}
}
/// Sets the width of the [`Button`].
- pub fn width(mut self, width: Length) -> Self {
- self.width = width;
+ pub fn width(mut self, width: impl Into<Length>) -> Self {
+ self.width = width.into();
self
}
/// Sets the height of the [`Button`].
- pub fn height(mut self, height: Length) -> Self {
- self.height = height;
+ pub fn height(mut self, height: impl Into<Length>) -> Self {
+ self.height = height.into();
self
}
@@ -434,7 +434,7 @@ pub fn layout<Renderer>(
let padding = padding.fit(content.size(), limits.max());
let size = limits.pad(padding).resolve(content.size()).pad(padding);
- content.move_to(Point::new(padding.left.into(), padding.top.into()));
+ content.move_to(Point::new(padding.left, padding.top));
layout::Node::with_children(size, vec![content])
}