diff options
Diffstat (limited to '')
-rw-r--r-- | core/src/element.rs | 1 | ||||
-rw-r--r-- | core/src/lib.rs | 2 | ||||
-rw-r--r-- | core/src/renderer.rs | 5 | ||||
-rw-r--r-- | core/src/shadow.rs | 15 |
4 files changed, 22 insertions, 1 deletions
diff --git a/core/src/element.rs b/core/src/element.rs index 8b510218..b264ad77 100644 --- a/core/src/element.rs +++ b/core/src/element.rs @@ -540,6 +540,7 @@ where border_color: color, border_width: 1.0, border_radius: 0.0.into(), + shadow: Default::default() }, Color::TRANSPARENT, ); diff --git a/core/src/lib.rs b/core/src/lib.rs index 864df6e6..b326d0f3 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -27,6 +27,7 @@ pub mod layout; pub mod mouse; pub mod overlay; pub mod renderer; +pub mod shadow; pub mod svg; pub mod text; pub mod time; @@ -70,6 +71,7 @@ pub use pixels::Pixels; pub use point::Point; pub use rectangle::Rectangle; pub use renderer::Renderer; +pub use shadow::Shadow; pub use shell::Shell; pub use size::Size; pub use text::Text; diff --git a/core/src/renderer.rs b/core/src/renderer.rs index 1b327e56..481048b0 100644 --- a/core/src/renderer.rs +++ b/core/src/renderer.rs @@ -5,7 +5,7 @@ mod null; #[cfg(debug_assertions)] pub use null::Null; -use crate::{Background, BorderRadius, Color, Rectangle, Vector}; +use crate::{Background, BorderRadius, Color, Rectangle, Shadow, Vector}; /// A component that can be used by widgets to draw themselves on a screen. pub trait Renderer: Sized { @@ -45,6 +45,9 @@ pub struct Quad { /// The border color of the [`Quad`]. pub border_color: Color, + + /// The shadow of the [`Quad`]. + pub shadow: Shadow, } /// The styling attributes of a [`Renderer`]. diff --git a/core/src/shadow.rs b/core/src/shadow.rs new file mode 100644 index 00000000..238ea36a --- /dev/null +++ b/core/src/shadow.rs @@ -0,0 +1,15 @@ +//! Shadow +use crate::{Color, Vector}; + +/// A shadow +#[derive(Debug, Clone, Copy, PartialEq, Default)] +pub struct Shadow { + /// The color of the shadow + pub color: Color, + + /// The offset of the shadow + pub offset: Vector, + + /// The blur_radius of the shadow + pub blur_radius: f32, +} |