summaryrefslogtreecommitdiffstats
path: root/native/src/widget/button.rs
diff options
context:
space:
mode:
authorLibravatar Giuliano Bellini <100347457+GyulyVGC@users.noreply.github.com>2023-02-22 21:23:04 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-22 21:23:04 +0100
commit4f41927155e7d4bc38497b0e298a0b23ccea6ca1 (patch)
tree70b7dbc1afdc62dfeaf42f0c62e8f4c01e407729 /native/src/widget/button.rs
parenta35d6d2e4d59f71309f31c87ea5150959d639185 (diff)
parent666f3cd143047e49a010f0c97eabc7136f92aa35 (diff)
downloadiced-4f41927155e7d4bc38497b0e298a0b23ccea6ca1.tar.gz
iced-4f41927155e7d4bc38497b0e298a0b23ccea6ca1.tar.bz2
iced-4f41927155e7d4bc38497b0e298a0b23ccea6ca1.zip
Merge branch 'iced-rs:master' into master
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])
}