diff options
author | 2019-11-07 17:44:27 +0100 | |
---|---|---|
committer | 2019-11-07 17:44:27 +0100 | |
commit | 59ef7f074c67126dd8bd0ae9cbc82ce2a946258f (patch) | |
tree | 5004ae812a39d36b3880d340101806edcf6abd04 /wgpu/src/renderer/widget/radio.rs | |
parent | 6790f4b6e36f21b5db9ef02f5e499df8336abfea (diff) | |
parent | e7bd24c13eb0c5c2b8ecf3f09f9e2de315bf8a41 (diff) | |
download | iced-59ef7f074c67126dd8bd0ae9cbc82ce2a946258f.tar.gz iced-59ef7f074c67126dd8bd0ae9cbc82ce2a946258f.tar.bz2 iced-59ef7f074c67126dd8bd0ae9cbc82ce2a946258f.zip |
Merge pull request #46 from memoryruins/from-array
impl From<Array> for Color
Diffstat (limited to 'wgpu/src/renderer/widget/radio.rs')
-rw-r--r-- | wgpu/src/renderer/widget/radio.rs | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/wgpu/src/renderer/widget/radio.rs b/wgpu/src/renderer/widget/radio.rs index 97b4f70e..61f5ce47 100644 --- a/wgpu/src/renderer/widget/radio.rs +++ b/wgpu/src/renderer/widget/radio.rs @@ -1,6 +1,6 @@ use crate::{Primitive, Renderer}; use iced_native::{ - radio, text, Align, Background, Color, Column, Layout, Length, MouseCursor, + radio, text, Align, Background, Column, Layout, Length, MouseCursor, Node, Point, Radio, Rectangle, Row, Text, Widget, }; @@ -41,12 +41,7 @@ impl radio::Renderer for Renderer { let (radio_border, radio_box) = ( Primitive::Quad { bounds: radio_bounds, - background: Background::Color(Color { - r: 0.6, - g: 0.6, - b: 0.6, - a: 1.0, - }), + background: Background::Color([0.6, 0.6, 0.6].into()), border_radius: (SIZE / 2.0) as u16, }, Primitive::Quad { @@ -56,21 +51,14 @@ impl radio::Renderer for Renderer { width: radio_bounds.width - 2.0, height: radio_bounds.height - 2.0, }, - background: Background::Color(if is_mouse_over { - Color { - r: 0.90, - g: 0.90, - b: 0.90, - a: 1.0, + background: Background::Color( + if is_mouse_over { + [0.90, 0.90, 0.90] + } else { + [0.95, 0.95, 0.95] } - } else { - Color { - r: 0.95, - g: 0.95, - b: 0.95, - a: 1.0, - } - }), + .into(), + ), border_radius: (SIZE / 2.0 - 1.0) as u16, }, ); @@ -85,12 +73,7 @@ impl radio::Renderer for Renderer { width: radio_bounds.width - DOT_SIZE, height: radio_bounds.height - DOT_SIZE, }, - background: Background::Color(Color { - r: 0.30, - g: 0.30, - b: 0.30, - a: 1.0, - }), + background: Background::Color([0.3, 0.3, 0.3].into()), border_radius: (DOT_SIZE / 2.0) as u16, }; |