From cc906c83cdf896d94b7ccf91258466714be631f6 Mon Sep 17 00:00:00 2001 From: Nick Senger Date: Wed, 8 Nov 2023 19:12:53 -0800 Subject: feat: quad shadows --- widget/src/radio.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'widget/src/radio.rs') diff --git a/widget/src/radio.rs b/widget/src/radio.rs index f91b20b1..0a33825f 100644 --- a/widget/src/radio.rs +++ b/widget/src/radio.rs @@ -315,6 +315,7 @@ where border_radius: (size / 2.0).into(), border_width: custom_style.border_width, border_color: custom_style.border_color, + shadow: Default::default(), }, custom_style.background, ); @@ -331,6 +332,7 @@ where border_radius: (dot_size / 2.0).into(), border_width: 0.0, border_color: Color::TRANSPARENT, + shadow: Default::default(), }, custom_style.dot_color, ); -- cgit From 370b2f6df799c948188d3949e34112258b2a8498 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 20 Jan 2024 12:25:07 +0100 Subject: Use `Default` implementation of `renderer::Quad` --- widget/src/radio.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'widget/src/radio.rs') diff --git a/widget/src/radio.rs b/widget/src/radio.rs index 0a33825f..a782812e 100644 --- a/widget/src/radio.rs +++ b/widget/src/radio.rs @@ -9,8 +9,7 @@ use crate::core::touch; use crate::core::widget; use crate::core::widget::tree::{self, Tree}; use crate::core::{ - Clipboard, Color, Element, Layout, Length, Pixels, Rectangle, Shell, Size, - Widget, + Clipboard, Element, Layout, Length, Pixels, Rectangle, Shell, Size, Widget, }; pub use iced_style::radio::{Appearance, StyleSheet}; @@ -315,7 +314,7 @@ where border_radius: (size / 2.0).into(), border_width: custom_style.border_width, border_color: custom_style.border_color, - shadow: Default::default(), + ..renderer::Quad::default() }, custom_style.background, ); @@ -330,9 +329,7 @@ where height: bounds.height - dot_size, }, border_radius: (dot_size / 2.0).into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - shadow: Default::default(), + ..renderer::Quad::default() }, custom_style.dot_color, ); -- cgit From 25f182f933ea6b7c112c8f9a450a98dc9b9eebdd Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 20 Jan 2024 13:29:25 +0100 Subject: Introduce `Border` struct analogous to `Shadow` --- widget/src/radio.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'widget/src/radio.rs') diff --git a/widget/src/radio.rs b/widget/src/radio.rs index a782812e..ceb51ead 100644 --- a/widget/src/radio.rs +++ b/widget/src/radio.rs @@ -9,7 +9,8 @@ use crate::core::touch; use crate::core::widget; use crate::core::widget::tree::{self, Tree}; use crate::core::{ - Clipboard, Element, Layout, Length, Pixels, Rectangle, Shell, Size, Widget, + Border, Clipboard, Element, Layout, Length, Pixels, Rectangle, Shell, Size, + Widget, }; pub use iced_style::radio::{Appearance, StyleSheet}; @@ -311,9 +312,11 @@ where renderer.fill_quad( renderer::Quad { bounds, - border_radius: (size / 2.0).into(), - border_width: custom_style.border_width, - border_color: custom_style.border_color, + border: Border { + radius: (size / 2.0).into(), + width: custom_style.border_width, + color: custom_style.border_color, + }, ..renderer::Quad::default() }, custom_style.background, @@ -328,7 +331,7 @@ where width: bounds.width - dot_size, height: bounds.height - dot_size, }, - border_radius: (dot_size / 2.0).into(), + border: Border::with_radius(dot_size / 2.0), ..renderer::Quad::default() }, custom_style.dot_color, -- cgit