diff options
author | 2024-01-20 12:25:07 +0100 | |
---|---|---|
committer | 2024-01-20 12:25:07 +0100 | |
commit | 370b2f6df799c948188d3949e34112258b2a8498 (patch) | |
tree | 925d98d94be0e82c34377a7e3f697eafc8d095a2 /examples | |
parent | b7b457a575cdd103915994f640c50262ce30a7c5 (diff) | |
download | iced-370b2f6df799c948188d3949e34112258b2a8498.tar.gz iced-370b2f6df799c948188d3949e34112258b2a8498.tar.bz2 iced-370b2f6df799c948188d3949e34112258b2a8498.zip |
Use `Default` implementation of `renderer::Quad`
Diffstat (limited to 'examples')
-rw-r--r-- | examples/custom_widget/src/main.rs | 4 | ||||
-rw-r--r-- | examples/loading_spinners/src/linear.rs | 17 | ||||
-rw-r--r-- | examples/modal/src/main.rs | 4 |
3 files changed, 6 insertions, 19 deletions
diff --git a/examples/custom_widget/src/main.rs b/examples/custom_widget/src/main.rs index f5c34d6b..6578183d 100644 --- a/examples/custom_widget/src/main.rs +++ b/examples/custom_widget/src/main.rs @@ -63,9 +63,7 @@ mod circle { renderer::Quad { bounds: layout.bounds(), border_radius: self.radius.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - shadow: Default::default(), + ..renderer::Quad::default() }, Color::BLACK, ); diff --git a/examples/loading_spinners/src/linear.rs b/examples/loading_spinners/src/linear.rs index 86469681..03aee9b1 100644 --- a/examples/loading_spinners/src/linear.rs +++ b/examples/loading_spinners/src/linear.rs @@ -225,10 +225,7 @@ where width: bounds.width, height: bounds.height, }, - border_radius: 0.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - shadow: Default::default(), + ..renderer::Quad::default() }, Background::Color(custom_style.track_color), ); @@ -242,10 +239,7 @@ where width: self.easing.y_at_x(*progress) * bounds.width, height: bounds.height, }, - border_radius: 0.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - shadow: Default::default(), + ..renderer::Quad::default() }, Background::Color(custom_style.bar_color), ), @@ -260,10 +254,7 @@ where * bounds.width, height: bounds.height, }, - border_radius: 0.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - shadow: Default::default(), + ..renderer::Quad::default() }, Background::Color(custom_style.bar_color), ), @@ -291,7 +282,7 @@ pub struct Appearance { pub bar_color: Color, } -impl std::default::Default for Appearance { +impl Default for Appearance { fn default() -> Self { Self { track_color: Color::TRANSPARENT, diff --git a/examples/modal/src/main.rs b/examples/modal/src/main.rs index 531a19b5..59287c06 100644 --- a/examples/modal/src/main.rs +++ b/examples/modal/src/main.rs @@ -475,9 +475,7 @@ mod modal { renderer::Quad { bounds: layout.bounds(), border_radius: BorderRadius::default(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - shadow: Default::default(), + ..renderer::Quad::default() }, Color { a: 0.80, |