diff options
author | 2020-01-05 19:34:38 +0100 | |
---|---|---|
committer | 2020-01-05 19:34:38 +0100 | |
commit | 07ef59af78107db103b7a9640a660ecae95b1156 (patch) | |
tree | 3755574ef1049dbc02c764cd33fc2894e099e6b1 /style | |
parent | 1a0effa961344677daf17b4192243423a154f1bf (diff) | |
download | iced-07ef59af78107db103b7a9640a660ecae95b1156.tar.gz iced-07ef59af78107db103b7a9640a660ecae95b1156.tar.bz2 iced-07ef59af78107db103b7a9640a660ecae95b1156.zip |
Implement `Default` for `container::Style`
Diffstat (limited to 'style')
-rw-r--r-- | style/src/button.rs | 2 | ||||
-rw-r--r-- | style/src/container.rs | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/style/src/button.rs b/style/src/button.rs index 4a9dac45..03c9ab32 100644 --- a/style/src/button.rs +++ b/style/src/button.rs @@ -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, diff --git a/style/src/container.rs b/style/src/container.rs index 484fdfda..d2247342 100644 --- a/style/src/container.rs +++ b/style/src/container.rs @@ -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. |