Draft basic styling for TextInput

This commit is contained in:
Héctor Ramón Jiménez 2020-01-01 18:26:49 +01:00
parent d96ced8e2d
commit 5af4159848
10 changed files with 143 additions and 36 deletions

View file

@ -12,6 +12,12 @@ pub struct Style {
/// A set of rules that dictate the style of a container.
pub trait StyleSheet {
/// Produces the style of a container.
fn style(&self) -> Style;
}
struct Default;
impl StyleSheet for Default {
fn style(&self) -> Style {
Style {
text_color: None,
@ -21,10 +27,6 @@ pub trait StyleSheet {
}
}
struct Default;
impl StyleSheet for Default {}
impl std::default::Default for Box<dyn StyleSheet> {
fn default() -> Self {
Box::new(Default)