summaryrefslogtreecommitdiffstats
path: root/wgpu/src/renderer/widget/text_input.rs
diff options
context:
space:
mode:
authorLibravatar memoryruins <memoryruinsmusic@gmail.com>2019-11-07 01:03:29 -0500
committerLibravatar memoryruins <memoryruinsmusic@gmail.com>2019-11-07 01:03:29 -0500
commite7bd24c13eb0c5c2b8ecf3f09f9e2de315bf8a41 (patch)
treecd15929a84965238b3aecf5d37214182079eb868 /wgpu/src/renderer/widget/text_input.rs
parent58bd0824bf458b6a5b21ade1efe998b1439469cd (diff)
downloadiced-e7bd24c13eb0c5c2b8ecf3f09f9e2de315bf8a41.tar.gz
iced-e7bd24c13eb0c5c2b8ecf3f09f9e2de315bf8a41.tar.bz2
iced-e7bd24c13eb0c5c2b8ecf3f09f9e2de315bf8a41.zip
use Color's `From` impl in more places
Diffstat (limited to 'wgpu/src/renderer/widget/text_input.rs')
-rw-r--r--wgpu/src/renderer/widget/text_input.rs34
1 files changed, 8 insertions, 26 deletions
diff --git a/wgpu/src/renderer/widget/text_input.rs b/wgpu/src/renderer/widget/text_input.rs
index cff8bf23..b5f6c5f6 100644
--- a/wgpu/src/renderer/widget/text_input.rs
+++ b/wgpu/src/renderer/widget/text_input.rs
@@ -25,20 +25,11 @@ impl text_input::Renderer for Renderer {
bounds,
background: Background::Color(
if is_mouse_over || text_input.state.is_focused {
- Color {
- r: 0.5,
- g: 0.5,
- b: 0.5,
- a: 1.0,
- }
+ [0.5, 0.5, 0.5]
} else {
- Color {
- r: 0.7,
- g: 0.7,
- b: 0.7,
- a: 1.0,
- }
- },
+ [0.7, 0.7, 0.7]
+ }
+ .into(),
),
border_radius: 5,
};
@@ -64,20 +55,11 @@ impl text_input::Renderer for Renderer {
text.clone()
},
color: if text.is_empty() {
- Color {
- r: 0.7,
- g: 0.7,
- b: 0.7,
- a: 1.0,
- }
+ [0.7, 0.7, 0.7]
} else {
- Color {
- r: 0.3,
- g: 0.3,
- b: 0.3,
- a: 1.0,
- }
- },
+ [0.3, 0.3, 0.3]
+ }
+ .into(),
bounds: Rectangle {
width: f32::INFINITY,
..text_bounds