Add interactivity to Checkbox component (#3240)

This PR adds interactivity to the `Checkbox` component.

They can now be checked and unchecked by clicking them.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2023-11-06 19:22:25 +01:00 committed by GitHub
parent 254b369624
commit d224f511fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 108 additions and 58 deletions

View file

@ -61,7 +61,7 @@ impl ButtonVariant {
}
}
pub type ClickHandler<S> = Arc<dyn Fn(&mut S, &mut ViewContext<S>) + Send + Sync>;
pub type ClickHandler<V> = Arc<dyn Fn(&mut V, &mut ViewContext<V>) + Send + Sync>;
struct ButtonHandlers<V: 'static> {
click: Option<ClickHandler<V>>,