From a467a037c3aee6cf659ec11a8deb744ca0408c59 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 17 Feb 2023 16:23:29 +0100 Subject: Use `Pixels` for `spacing` --- native/src/widget/checkbox.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'native/src/widget/checkbox.rs') diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs index dc00052d..9b69e574 100644 --- a/native/src/widget/checkbox.rs +++ b/native/src/widget/checkbox.rs @@ -53,7 +53,7 @@ where label: String, width: Length, size: f32, - spacing: u16, + spacing: f32, text_size: Option, font: Renderer::Font, icon: Icon, @@ -69,7 +69,7 @@ where const DEFAULT_SIZE: f32 = 20.0; /// The default spacing of a [`Checkbox`]. - const DEFAULT_SPACING: u16 = 15; + const DEFAULT_SPACING: f32 = 15.0; /// Creates a new [`Checkbox`]. /// @@ -114,8 +114,8 @@ where } /// Sets the spacing between the [`Checkbox`] and the text. - pub fn spacing(mut self, spacing: u16) -> Self { - self.spacing = spacing; + pub fn spacing(mut self, spacing: impl Into) -> Self { + self.spacing = spacing.into().0; self } -- cgit