Fix Checkbox and Radio API in iced_web
This commit is contained in:
parent
67fd107746
commit
f7825fd936
3 changed files with 10 additions and 5 deletions
|
|
@ -43,14 +43,14 @@ impl<Message> Checkbox<Message> {
|
|||
/// `Message`.
|
||||
///
|
||||
/// [`Checkbox`]: struct.Checkbox.html
|
||||
pub fn new<F>(is_checked: bool, label: &str, f: F) -> Self
|
||||
pub fn new<F>(is_checked: bool, label: impl Into<String>, f: F) -> Self
|
||||
where
|
||||
F: 'static + Fn(bool) -> Message,
|
||||
{
|
||||
Checkbox {
|
||||
is_checked,
|
||||
on_toggle: Rc::new(f),
|
||||
label: String::from(label),
|
||||
label: label.into(),
|
||||
width: Length::Shrink,
|
||||
style: Default::default(),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue