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/vertical_slider.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'widget/src/vertical_slider.rs') diff --git a/widget/src/vertical_slider.rs b/widget/src/vertical_slider.rs index a3029d76..4fdad861 100644 --- a/widget/src/vertical_slider.rs +++ b/widget/src/vertical_slider.rs @@ -400,6 +400,7 @@ pub fn draw( border_radius: style.rail.border_radius, border_width: 0.0, border_color: Color::TRANSPARENT, + shadow: Default::default(), }, style.rail.colors.1, ); @@ -415,6 +416,7 @@ pub fn draw( border_radius: style.rail.border_radius, border_width: 0.0, border_color: Color::TRANSPARENT, + shadow: Default::default(), }, style.rail.colors.0, ); @@ -430,6 +432,7 @@ pub fn draw( border_radius: handle_border_radius, border_width: style.handle.border_width, border_color: style.handle.border_color, + shadow: Default::default(), }, style.handle.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/vertical_slider.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'widget/src/vertical_slider.rs') diff --git a/widget/src/vertical_slider.rs b/widget/src/vertical_slider.rs index 4fdad861..7a461b08 100644 --- a/widget/src/vertical_slider.rs +++ b/widget/src/vertical_slider.rs @@ -13,8 +13,7 @@ use crate::core::renderer; use crate::core::touch; use crate::core::widget::tree::{self, Tree}; use crate::core::{ - Clipboard, Color, Element, Length, Pixels, Point, Rectangle, Shell, Size, - Widget, + Clipboard, Element, Length, Pixels, Point, Rectangle, Shell, Size, Widget, }; /// An vertical bar and a handle that selects a single value from a range of @@ -398,9 +397,7 @@ pub fn draw( height: offset + handle_width / 2.0, }, border_radius: style.rail.border_radius, - border_width: 0.0, - border_color: Color::TRANSPARENT, - shadow: Default::default(), + ..renderer::Quad::default() }, style.rail.colors.1, ); @@ -414,9 +411,7 @@ pub fn draw( height: bounds.height - offset - handle_width / 2.0, }, border_radius: style.rail.border_radius, - border_width: 0.0, - border_color: Color::TRANSPARENT, - shadow: Default::default(), + ..renderer::Quad::default() }, style.rail.colors.0, ); @@ -432,7 +427,7 @@ pub fn draw( border_radius: handle_border_radius, border_width: style.handle.border_width, border_color: style.handle.border_color, - shadow: Default::default(), + ..renderer::Quad::default() }, style.handle.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/vertical_slider.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'widget/src/vertical_slider.rs') diff --git a/widget/src/vertical_slider.rs b/widget/src/vertical_slider.rs index 7a461b08..52428c10 100644 --- a/widget/src/vertical_slider.rs +++ b/widget/src/vertical_slider.rs @@ -13,7 +13,8 @@ use crate::core::renderer; use crate::core::touch; use crate::core::widget::tree::{self, Tree}; use crate::core::{ - Clipboard, Element, Length, Pixels, Point, Rectangle, Shell, Size, Widget, + Border, Clipboard, Element, Length, Pixels, Point, Rectangle, Shell, Size, + Widget, }; /// An vertical bar and a handle that selects a single value from a range of @@ -396,7 +397,7 @@ pub fn draw( width: style.rail.width, height: offset + handle_width / 2.0, }, - border_radius: style.rail.border_radius, + border: Border::with_radius(style.rail.border_radius), ..renderer::Quad::default() }, style.rail.colors.1, @@ -410,7 +411,7 @@ pub fn draw( width: style.rail.width, height: bounds.height - offset - handle_width / 2.0, }, - border_radius: style.rail.border_radius, + border: Border::with_radius(style.rail.border_radius), ..renderer::Quad::default() }, style.rail.colors.0, @@ -424,9 +425,11 @@ pub fn draw( width: handle_height, height: handle_width, }, - border_radius: handle_border_radius, - border_width: style.handle.border_width, - border_color: style.handle.border_color, + border: Border { + radius: handle_border_radius, + width: style.handle.border_width, + color: style.handle.border_color, + }, ..renderer::Quad::default() }, style.handle.color, -- cgit