summaryrefslogtreecommitdiffstats
path: root/native/src/widget/radio.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-17 16:23:29 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-17 16:23:29 +0100
commita467a037c3aee6cf659ec11a8deb744ca0408c59 (patch)
treed1f5f5bb6b5b504e8e72034d2912865c7d55cfdc /native/src/widget/radio.rs
parentfd3a141024a11e17bba0c568f0df7ff34b79315b (diff)
downloadiced-a467a037c3aee6cf659ec11a8deb744ca0408c59.tar.gz
iced-a467a037c3aee6cf659ec11a8deb744ca0408c59.tar.bz2
iced-a467a037c3aee6cf659ec11a8deb744ca0408c59.zip
Use `Pixels` for `spacing`
Diffstat (limited to '')
-rw-r--r--native/src/widget/radio.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/native/src/widget/radio.rs b/native/src/widget/radio.rs
index 4477b810..9daddfbc 100644
--- a/native/src/widget/radio.rs
+++ b/native/src/widget/radio.rs
@@ -51,7 +51,7 @@ where
label: String,
width: Length,
size: f32,
- spacing: u16,
+ spacing: f32,
text_size: Option<f32>,
font: Renderer::Font,
style: <Renderer::Theme as StyleSheet>::Style,
@@ -67,7 +67,7 @@ where
pub const DEFAULT_SIZE: f32 = 28.0;
/// The default spacing of a [`Radio`] button.
- pub const DEFAULT_SPACING: u16 = 15;
+ pub const DEFAULT_SPACING: f32 = 15.0;
/// Creates a new [`Radio`] button.
///
@@ -113,8 +113,8 @@ where
}
/// Sets the spacing between the [`Radio`] button and the text.
- pub fn spacing(mut self, spacing: u16) -> Self {
- self.spacing = spacing;
+ pub fn spacing(mut self, spacing: impl Into<Pixels>) -> Self {
+ self.spacing = spacing.into().0;
self
}