diff options
author | 2019-11-24 19:15:28 +0100 | |
---|---|---|
committer | 2019-11-24 19:15:28 +0100 | |
commit | bbcd16c3358e641b8ab1877b802d1f7c5709943d (patch) | |
tree | 72c805ce46792f3c038d2d7ea127263ae965a779 /web/src/widget/radio.rs | |
parent | 700390bdb297a5fc2eb356b10f9ed2656cc75daa (diff) | |
parent | 2b2a0f12c75032453fbefd2491d3ef51ff0ba88e (diff) | |
download | iced-bbcd16c3358e641b8ab1877b802d1f7c5709943d.tar.gz iced-bbcd16c3358e641b8ab1877b802d1f7c5709943d.tar.bz2 iced-bbcd16c3358e641b8ab1877b802d1f7c5709943d.zip |
Merge pull request #66 from hecrj/feature/new-web-tour
Make `tour` work with `iced_web` again
Diffstat (limited to '')
-rw-r--r-- | web/src/widget/radio.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/web/src/widget/radio.rs b/web/src/widget/radio.rs index 32532ebe..4e7d02b8 100644 --- a/web/src/widget/radio.rs +++ b/web/src/widget/radio.rs @@ -1,4 +1,4 @@ -use crate::{Bus, Color, Element, Widget}; +use crate::{style, Bus, Color, Element, Widget}; use dodrio::bumpalo; @@ -70,29 +70,31 @@ impl<Message> Radio<Message> { impl<Message> Widget<Message> for Radio<Message> where - Message: 'static + Copy, + Message: 'static + Clone, { fn node<'b>( &self, bump: &'b bumpalo::Bump, bus: &Bus<Message>, + _style_sheet: &mut style::Sheet<'b>, ) -> dodrio::Node<'b> { use dodrio::builder::*; let radio_label = bumpalo::format!(in bump, "{}", self.label); let event_bus = bus.clone(); - let on_click = self.on_click; + let on_click = self.on_click.clone(); // TODO: Complete styling label(bump) - .attr("style", "display: block") + .attr("style", "display: block; font-size: 20px") .children(vec![ input(bump) .attr("type", "radio") + .attr("style", "margin-right: 10px") .bool_attr("checked", self.is_selected) .on("click", move |root, vdom, _event| { - event_bus.publish(on_click, root); + event_bus.publish(on_click.clone(), root); vdom.schedule_render(); }) @@ -105,7 +107,7 @@ where impl<'a, Message> From<Radio<Message>> for Element<'a, Message> where - Message: 'static + Copy, + Message: 'static + Clone, { fn from(radio: Radio<Message>) -> Element<'a, Message> { Element::new(radio) |