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:
parent
254b369624
commit
d224f511fa
5 changed files with 108 additions and 58 deletions
|
@ -155,9 +155,18 @@ impl InteractionState {
|
|||
}
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Eq, Hash, Clone, Copy)]
|
||||
pub enum Selected {
|
||||
pub enum Selection {
|
||||
#[default]
|
||||
Unselected,
|
||||
Indeterminate,
|
||||
Selected,
|
||||
}
|
||||
|
||||
impl Selection {
|
||||
pub fn inverse(&self) -> Self {
|
||||
match self {
|
||||
Self::Unselected | Self::Indeterminate => Self::Selected,
|
||||
Self::Selected => Self::Unselected,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue