summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-06 00:33:26 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-06 00:33:26 +0100
commitb4a8471aa187de511301605a56cf531923dfb6bd (patch)
tree45434968f308871e4d51f463d466fcfbc0cc031a /web
parentabdae3a7ec1413df86fca93699fb2448226e2da5 (diff)
downloadiced-b4a8471aa187de511301605a56cf531923dfb6bd.tar.gz
iced-b4a8471aa187de511301605a56cf531923dfb6bd.tar.bz2
iced-b4a8471aa187de511301605a56cf531923dfb6bd.zip
Expose styling types for `radio` in `iced_web`
Diffstat (limited to 'web')
-rw-r--r--web/src/widget/radio.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/web/src/widget/radio.rs b/web/src/widget/radio.rs
index e8721cee..e00e26db 100644
--- a/web/src/widget/radio.rs
+++ b/web/src/widget/radio.rs
@@ -1,5 +1,7 @@
//! Create choices using radio buttons.
-use crate::{Bus, Color, Css, Element, Widget};
+use crate::{Bus, Css, Element, Widget};
+
+pub use iced_style::radio::{Style, StyleSheet};
use dodrio::bumpalo;
@@ -33,7 +35,7 @@ pub struct Radio<Message> {
is_selected: bool,
on_click: Message,
label: String,
- label_color: Option<Color>,
+ style: Box<dyn StyleSheet>,
}
impl<Message> Radio<Message> {
@@ -56,15 +58,15 @@ impl<Message> Radio<Message> {
is_selected: Some(value) == selected,
on_click: f(value),
label: String::from(label),
- label_color: None,
+ style: Default::default(),
}
}
- /// Sets the `Color` of the label of the [`Radio`].
+ /// Sets the style of the [`Radio`] button.
///
/// [`Radio`]: struct.Radio.html
- pub fn label_color<C: Into<Color>>(mut self, color: C) -> Self {
- self.label_color = Some(color.into());
+ pub fn style(mut self, style: impl Into<Box<dyn StyleSheet>>) -> Self {
+ self.style = style.into();
self
}
}