diff options
author | 2022-01-21 19:27:17 +0700 | |
---|---|---|
committer | 2022-01-21 19:27:17 +0700 | |
commit | 04efd22dbaffbbb251c871aa7c1e81cdf31eb5f0 (patch) | |
tree | 992ba4bdf00ff84f9d068d40375ef75d6596df9c /native/src/widget/checkbox.rs | |
parent | 5a1638add8c42bd444448e35dbbbbcc23ebaa4d2 (diff) | |
parent | 93285d85b0413553286f8cc48cba4036260e5be1 (diff) | |
download | iced-04efd22dbaffbbb251c871aa7c1e81cdf31eb5f0.tar.gz iced-04efd22dbaffbbb251c871aa7c1e81cdf31eb5f0.tar.bz2 iced-04efd22dbaffbbb251c871aa7c1e81cdf31eb5f0.zip |
Merge pull request #1209 from iced-rs/checkbox-radio-text-color
Remove ambiguous `text_color` attributes for `Checkbox` and `Radio`
Diffstat (limited to 'native/src/widget/checkbox.rs')
-rw-r--r-- | native/src/widget/checkbox.rs | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs index a314140c..fff65a40 100644 --- a/native/src/widget/checkbox.rs +++ b/native/src/widget/checkbox.rs @@ -10,8 +10,8 @@ use crate::text; use crate::touch; use crate::widget::{self, Row, Text}; use crate::{ - Alignment, Clipboard, Color, Element, Hasher, Layout, Length, Point, - Rectangle, Shell, Widget, + Alignment, Clipboard, Element, Hasher, Layout, Length, Point, Rectangle, + Shell, Widget, }; pub use iced_style::checkbox::{Style, StyleSheet}; @@ -43,7 +43,6 @@ pub struct Checkbox<'a, Message, Renderer: text::Renderer> { spacing: u16, text_size: Option<u16>, font: Renderer::Font, - text_color: Option<Color>, style_sheet: Box<dyn StyleSheet + 'a>, } @@ -75,7 +74,6 @@ impl<'a, Message, Renderer: text::Renderer> Checkbox<'a, Message, Renderer> { spacing: Self::DEFAULT_SPACING, text_size: None, font: Renderer::Font::default(), - text_color: None, style_sheet: Default::default(), } } @@ -112,12 +110,6 @@ impl<'a, Message, Renderer: text::Renderer> Checkbox<'a, Message, Renderer> { self } - /// Sets the text color of the [`Checkbox`] button. - pub fn text_color(mut self, color: Color) -> Self { - self.text_color = Some(color); - self - } - /// Sets the style of the [`Checkbox`]. pub fn style( mut self, @@ -264,7 +256,7 @@ where &self.label, self.font.clone(), self.text_size, - self.text_color.or(Some(custom_style.text_color)), + custom_style.text_color, alignment::Horizontal::Left, alignment::Vertical::Center, ); |