diff options
author | 2024-01-20 13:52:15 +0100 | |
---|---|---|
committer | 2024-01-20 13:52:15 +0100 | |
commit | 545cc909c9f356dd733d273173694db9b8c28594 (patch) | |
tree | c8132edab4386bbccb07a372c3776f22abefbda3 /style/src/container.rs | |
parent | b3e3f6e3c9fc6879e6681810f54d7eaa7c0f3d30 (diff) | |
parent | 1c1667c3c99fa9b1009ef416b9b3c7e5a1d53a97 (diff) | |
download | iced-545cc909c9f356dd733d273173694db9b8c28594.tar.gz iced-545cc909c9f356dd733d273173694db9b8c28594.tar.bz2 iced-545cc909c9f356dd733d273173694db9b8c28594.zip |
Merge pull request #1882 from nicksenger/shadows
Quad shadows
Diffstat (limited to 'style/src/container.rs')
-rw-r--r-- | style/src/container.rs | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/style/src/container.rs b/style/src/container.rs index 490a9dab..00649c25 100644 --- a/style/src/container.rs +++ b/style/src/container.rs @@ -1,19 +1,17 @@ //! Change the appearance of a container. -use crate::core::{Background, BorderRadius, Color, Pixels}; +use crate::core::{Background, Border, Color, Pixels, Shadow}; /// The appearance of a container. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, Default)] pub struct Appearance { /// The text [`Color`] of the container. pub text_color: Option<Color>, /// The [`Background`] of the container. pub background: Option<Background>, - /// The border radius of the container. - pub border_radius: BorderRadius, - /// The border width of the container. - pub border_width: f32, - /// The border [`Color`] of the container. - pub border_color: Color, + /// The [`Border`] of the container. + pub border: Border, + /// The [`Shadow`] of the container. + pub shadow: Shadow, } impl Appearance { @@ -25,8 +23,11 @@ impl Appearance { width: impl Into<Pixels>, ) -> Self { Self { - border_color: color.into(), - border_width: width.into().0, + border: Border { + color: color.into(), + width: width.into().0, + ..Border::default() + }, ..self } } @@ -40,18 +41,6 @@ impl Appearance { } } -impl std::default::Default for Appearance { - fn default() -> Self { - Self { - text_color: None, - background: None, - border_radius: 0.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - } - } -} - /// A set of rules that dictate the [`Appearance`] of a container. pub trait StyleSheet { /// The supported style of the [`StyleSheet`]. |