Implement `Default` for `Style` in `rule`
This commit is contained in:
parent
e292821c37
commit
662889bb83
|
@ -79,6 +79,17 @@ pub struct Style {
|
||||||
pub fill_mode: FillMode,
|
pub fill_mode: FillMode,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::default::Default for Style {
|
||||||
|
fn default() -> Self {
|
||||||
|
Style {
|
||||||
|
color: [0.6, 0.6, 0.6, 0.51].into(),
|
||||||
|
width: 1,
|
||||||
|
radius: 0.0,
|
||||||
|
fill_mode: FillMode::Percent(90.0),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A set of rules that dictate the style of a rule.
|
/// A set of rules that dictate the style of a rule.
|
||||||
pub trait StyleSheet {
|
pub trait StyleSheet {
|
||||||
/// Produces the style of a rule.
|
/// Produces the style of a rule.
|
||||||
|
@ -89,12 +100,7 @@ struct Default;
|
||||||
|
|
||||||
impl StyleSheet for Default {
|
impl StyleSheet for Default {
|
||||||
fn style(&self) -> Style {
|
fn style(&self) -> Style {
|
||||||
Style {
|
Style::default()
|
||||||
color: [0.6, 0.6, 0.6, 0.51].into(),
|
|
||||||
width: 1,
|
|
||||||
radius: 0.0,
|
|
||||||
fill_mode: FillMode::Percent(90.0),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue