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/scrollable.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'widget/src/scrollable.rs') diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index 70db490a..82602a41 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -912,6 +912,7 @@ pub fn draw( border_radius: style.border_radius, border_width: style.border_width, border_color: style.border_color, + shadow: Default::default(), }, style .background @@ -932,6 +933,7 @@ pub fn draw( border_radius: style.scroller.border_radius, border_width: style.scroller.border_width, border_color: style.scroller.border_color, + shadow: Default::default(), }, style.scroller.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/scrollable.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'widget/src/scrollable.rs') diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index 82602a41..beaad704 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -912,7 +912,7 @@ pub fn draw( border_radius: style.border_radius, border_width: style.border_width, border_color: style.border_color, - shadow: Default::default(), + ..renderer::Quad::default() }, style .background @@ -933,7 +933,7 @@ pub fn draw( border_radius: style.scroller.border_radius, border_width: style.scroller.border_width, border_color: style.scroller.border_color, - shadow: Default::default(), + ..renderer::Quad::default() }, style.scroller.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/scrollable.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'widget/src/scrollable.rs') diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index beaad704..b7b6c3d2 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -903,15 +903,13 @@ pub fn draw( if scrollbar.bounds.width > 0.0 && scrollbar.bounds.height > 0.0 && (style.background.is_some() - || (style.border_color != Color::TRANSPARENT - && style.border_width > 0.0)) + || (style.border.color != Color::TRANSPARENT + && style.border.width > 0.0)) { renderer.fill_quad( renderer::Quad { bounds: scrollbar.bounds, - border_radius: style.border_radius, - border_width: style.border_width, - border_color: style.border_color, + border: style.border, ..renderer::Quad::default() }, style @@ -924,15 +922,13 @@ pub fn draw( if scrollbar.scroller.bounds.width > 0.0 && scrollbar.scroller.bounds.height > 0.0 && (style.scroller.color != Color::TRANSPARENT - || (style.scroller.border_color != Color::TRANSPARENT - && style.scroller.border_width > 0.0)) + || (style.scroller.border.color != Color::TRANSPARENT + && style.scroller.border.width > 0.0)) { renderer.fill_quad( renderer::Quad { bounds: scrollbar.scroller.bounds, - border_radius: style.scroller.border_radius, - border_width: style.scroller.border_width, - border_color: style.scroller.border_color, + border: style.scroller.border, ..renderer::Quad::default() }, style.scroller.color, -- cgit