Make example work on web and update READMEs
This commit is contained in:
parent
eda1048dbc
commit
86dede4c4c
13 changed files with 101 additions and 32 deletions
|
|
@ -2,7 +2,7 @@ use crate::{Bus, Element, Widget};
|
|||
|
||||
use dodrio::bumpalo;
|
||||
|
||||
pub type Button<'a, Message> = iced_core::Button<'a, Message>;
|
||||
pub use iced_core::button::*;
|
||||
|
||||
impl<'a, Message> Widget<Message> for Button<'a, Message>
|
||||
where
|
||||
|
|
@ -29,6 +29,8 @@ where
|
|||
});
|
||||
}
|
||||
|
||||
// TODO: Complete styling
|
||||
|
||||
node.finish()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ where
|
|||
let event_bus = bus.clone();
|
||||
let msg = (self.on_toggle)(!self.is_checked);
|
||||
|
||||
// TODO: Complete styling
|
||||
label(bump)
|
||||
.children(vec![
|
||||
input(bump)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ impl<'a, Message> Widget<Message> for Column<'a, Message> {
|
|||
.map(|element| element.widget.node(bump, publish))
|
||||
.collect();
|
||||
|
||||
// TODO: Complete styling
|
||||
div(bump)
|
||||
.attr("style", "display: flex; flex-direction: column")
|
||||
.children(children)
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ impl<'a, Message> Widget<Message> for Image<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: Complete styling
|
||||
|
||||
image.finish()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ where
|
|||
let event_bus = bus.clone();
|
||||
let on_click = self.on_click;
|
||||
|
||||
// TODO: Complete styling
|
||||
label(bump)
|
||||
.attr("style", "display: block")
|
||||
.children(vec![
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ impl<'a, Message> Widget<Message> for Row<'a, Message> {
|
|||
.map(|element| element.widget.node(bump, publish))
|
||||
.collect();
|
||||
|
||||
// TODO: Complete styling
|
||||
div(bump)
|
||||
.attr("style", "display: flex; flex-direction: row")
|
||||
.children(children)
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@ use crate::{Bus, Element, Widget};
|
|||
|
||||
use dodrio::bumpalo;
|
||||
|
||||
pub type Slider<'a, Message> = iced_core::Slider<'a, Message>;
|
||||
|
||||
pub use iced_core::slider::State;
|
||||
pub use iced_core::slider::*;
|
||||
|
||||
impl<'a, Message> Widget<Message> for Slider<'a, Message>
|
||||
where
|
||||
|
|
@ -28,6 +26,7 @@ where
|
|||
let event_bus = bus.clone();
|
||||
|
||||
// TODO: Make `step` configurable
|
||||
// TODO: Complete styling
|
||||
label(bump)
|
||||
.children(vec![input(bump)
|
||||
.attr("type", "range")
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ impl<'a, Message> Widget<Message> for Text {
|
|||
let content = bumpalo::format!(in bump, "{}", self.content);
|
||||
let size = bumpalo::format!(in bump, "font-size: {}px", self.size.unwrap_or(20));
|
||||
|
||||
// TODO: Complete styling
|
||||
p(bump)
|
||||
.attr("style", size.into_bump_str())
|
||||
.children(vec![text(content.into_bump_str())])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue