From e84e0b876c3c9547f5758c72f1cb971fdba71483 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 30 Aug 2019 01:42:22 +0200 Subject: Add example images to widget docs --- src/widget/radio.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/widget/radio.rs') diff --git a/src/widget/radio.rs b/src/widget/radio.rs index 8e2a5da6..7bcb0da2 100644 --- a/src/widget/radio.rs +++ b/src/widget/radio.rs @@ -25,12 +25,6 @@ use std::hash::Hash; /// Black, /// } /// -/// impl Default for Color { -/// fn default() -> Color { -/// Color::Black -/// } -/// } -/// /// #[derive(Debug, Clone, Copy, PartialEq, Eq)] /// pub enum Choice { /// A, @@ -44,11 +38,14 @@ use std::hash::Hash; /// /// let selected_choice = Some(Choice::A); /// -/// Radio::::new(Choice::A, "This is A", selected_choice, Message::RadioSelected) +/// Radio::new(Choice::A, "This is A", selected_choice, Message::RadioSelected) +/// .label_color(Color::Black); +/// +/// Radio::new(Choice::B, "This is B", selected_choice, Message::RadioSelected) /// .label_color(Color::Black); /// ``` /// -/// ![Checkbox drawn by the built-in renderer in Coffee](https://github.com/hecrj/coffee/blob/bda9818f823dfcb8a7ad0ff4940b4d4b387b5208/images/ui/radio.png?raw=true) +/// ![Radio buttons drawn by Coffee's renderer](https://github.com/hecrj/coffee/blob/bda9818f823dfcb8a7ad0ff4940b4d4b387b5208/images/ui/radio.png?raw=true) pub struct Radio { is_selected: bool, on_click: Message, @@ -108,7 +105,7 @@ impl Radio { impl Widget for Radio where - Color: 'static + Copy + Default + std::fmt::Debug, + Color: 'static + Copy + std::fmt::Debug, Renderer: self::Renderer + text::Renderer, Message: Copy + std::fmt::Debug, { @@ -205,7 +202,7 @@ pub trait Renderer { impl<'a, Color, Message, Renderer> From> for Element<'a, Message, Renderer> where - Color: 'static + Copy + Default + std::fmt::Debug, + Color: 'static + Copy + std::fmt::Debug, Renderer: self::Renderer + text::Renderer, Message: 'static + Copy + std::fmt::Debug, { -- cgit