use super::state::TextFieldConfig;
use super::style::{DefaultTextInputStyle, TextInputStyle};
use super::theme::{DefaultTextInputTheme, TextInputTheme};
pub struct TextInputSettings {
pub theme: Box<dyn TextInputTheme>,
pub style: Box<dyn TextInputStyle>,
pub config: TextFieldConfig,
}
impl TextInputSettings {
pub fn with_config(config: TextFieldConfig) -> Self {
Self {
theme: Box::new(DefaultTextInputTheme),
style: Box::new(DefaultTextInputStyle),
config,
}
}
pub fn with_theme(mut self, theme: Box<dyn TextInputTheme>) -> Self {
self.theme = theme;
self
}
pub fn with_style(mut self, style: Box<dyn TextInputStyle>) -> Self {
self.style = style;
self
}
}