Implement Default for container::Style

This commit is contained in:
Héctor Ramón Jiménez 2020-01-05 19:34:38 +01:00
parent 1a0effa961
commit 07ef59af78
2 changed files with 13 additions and 1 deletions

View File

@ -14,7 +14,7 @@ pub struct Style {
impl std::default::Default for Style {
fn default() -> Self {
Style {
Self {
shadow_offset: Vector::default(),
background: None,
border_radius: 0,

View File

@ -11,6 +11,18 @@ pub struct Style {
pub border_color: Color,
}
impl std::default::Default for Style {
fn default() -> Self {
Self {
text_color: None,
background: None,
border_radius: 0,
border_width: 0,
border_color: Color::TRANSPARENT,
}
}
}
/// A set of rules that dictate the style of a container.
pub trait StyleSheet {
/// Produces the style of a container.