summaryrefslogtreecommitdiffstats
path: root/core/src/renderer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-20 13:29:25 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-20 13:29:25 +0100
commit25f182f933ea6b7c112c8f9a450a98dc9b9eebdd (patch)
treefdc498d705f033d3c432e6a06b8cd223dfd82633 /core/src/renderer.rs
parent4d502012b3e3ed9d9ef80f21078d53d182cdaa1b (diff)
downloadiced-25f182f933ea6b7c112c8f9a450a98dc9b9eebdd.tar.gz
iced-25f182f933ea6b7c112c8f9a450a98dc9b9eebdd.tar.bz2
iced-25f182f933ea6b7c112c8f9a450a98dc9b9eebdd.zip
Introduce `Border` struct analogous to `Shadow`
Diffstat (limited to 'core/src/renderer.rs')
-rw-r--r--core/src/renderer.rs22
1 files changed, 7 insertions, 15 deletions
diff --git a/core/src/renderer.rs b/core/src/renderer.rs
index 1ca62559..a2a66aa8 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, Shadow, Size, Vector};
+use crate::{Background, Border, Color, Rectangle, Shadow, Size, Vector};
/// A component that can be used by widgets to draw themselves on a screen.
pub trait Renderer: Sized {
@@ -37,27 +37,19 @@ pub struct Quad {
/// The bounds of the [`Quad`].
pub bounds: Rectangle,
- /// The border radius of the [`Quad`].
- pub border_radius: BorderRadius,
+ /// The [`Border`] of the [`Quad`].
+ pub border: Border,
- /// The border width of the [`Quad`].
- pub border_width: f32,
-
- /// The border color of the [`Quad`].
- pub border_color: Color,
-
- /// The shadow of the [`Quad`].
- pub shadow: Option<Shadow>,
+ /// The [`Shadow`] of the [`Quad`].
+ pub shadow: Shadow,
}
impl Default for Quad {
fn default() -> Self {
Self {
bounds: Rectangle::with_size(Size::ZERO),
- border_radius: 0.0.into(),
- border_width: 0.0,
- border_color: Color::TRANSPARENT,
- shadow: None,
+ border: Border::default(),
+ shadow: Shadow::default(),
}
}
}