From 0a1922d4b378de23f55b117b07bad23dda0d64d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vuka=C5=A1in=20Vojinovi=C4=87?= <150025636+git-f0x@users.noreply.github.com> Date: Fri, 30 Aug 2024 13:42:24 +0200 Subject: [PATCH] improv(radio): reduce radio button size --- src/widget/radio.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/widget/radio.rs b/src/widget/radio.rs index 27c2a62e..c509b491 100644 --- a/src/widget/radio.rs +++ b/src/widget/radio.rs @@ -104,10 +104,10 @@ where Renderer: iced_core::Renderer, { /// The default size of a [`Radio`] button. - pub const DEFAULT_SIZE: f32 = 28.0; + pub const DEFAULT_SIZE: f32 = 16.0; /// The default spacing of a [`Radio`] button. - pub const DEFAULT_SPACING: f32 = 15.0; + pub const DEFAULT_SPACING: f32 = 8.0; /// Creates a new [`Radio`] button. /// @@ -129,7 +129,7 @@ where label: label.into(), width: Length::Shrink, size: Self::DEFAULT_SIZE, - spacing: Self::DEFAULT_SPACING, //15 + spacing: Self::DEFAULT_SPACING, style: Default::default(), } } @@ -312,7 +312,7 @@ where let bounds = layout.bounds(); let size = bounds.width; - let dot_size = size / 2.0; + let dot_size = 6.0; renderer.fill_quad( renderer::Quad { @@ -331,10 +331,10 @@ where renderer.fill_quad( renderer::Quad { bounds: Rectangle { - x: bounds.x + dot_size / 2.0, - y: bounds.y + dot_size / 2.0, - width: bounds.width - dot_size, - height: bounds.height - dot_size, + x: bounds.x + (size - dot_size) / 2.0, + y: bounds.y + (size - dot_size) / 2.0, + width: dot_size, + height: dot_size, }, border: Border::with_radius(dot_size / 2.0), ..renderer::Quad::default()