diff options
Diffstat (limited to 'style/src/text_input.rs')
-rw-r--r-- | style/src/text_input.rs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/style/src/text_input.rs b/style/src/text_input.rs index c5123b20..19acea65 100644 --- a/style/src/text_input.rs +++ b/style/src/text_input.rs @@ -5,8 +5,8 @@ use iced_core::{Background, Color}; #[derive(Debug, Clone, Copy)] pub struct Style { pub background: Background, - pub border_radius: u16, - pub border_width: u16, + pub border_radius: f32, + pub border_width: f32, pub border_color: Color, } @@ -14,8 +14,8 @@ impl std::default::Default for Style { fn default() -> Self { Self { background: Background::Color(Color::WHITE), - border_radius: 0, - border_width: 0, + border_radius: 0.0, + border_width: 0.0, border_color: Color::TRANSPARENT, } } @@ -33,6 +33,8 @@ pub trait StyleSheet { fn value_color(&self) -> Color; + fn selection_color(&self) -> Color; + /// Produces the style of an hovered text input. fn hovered(&self) -> Style { self.focused() @@ -45,8 +47,8 @@ impl StyleSheet for Default { fn active(&self) -> Style { Style { background: Background::Color(Color::WHITE), - border_radius: 5, - border_width: 1, + border_radius: 5.0, + border_width: 1.0, border_color: Color::from_rgb(0.7, 0.7, 0.7), } } @@ -65,6 +67,10 @@ impl StyleSheet for Default { fn value_color(&self) -> Color { Color::from_rgb(0.3, 0.3, 0.3) } + + fn selection_color(&self) -> Color { + Color::from_rgb(0.8, 0.8, 1.0) + } } impl std::default::Default for Box<dyn StyleSheet> { |