uzor 1.3.0

Core UI engine — geometry, interaction, input state
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Checkbox persistent state.

/// Persistent state for a checkbox widget.
#[derive(Debug, Default, Clone)]
pub struct CheckboxState {
    /// Whether the checkbox is currently checked.
    pub checked: bool,
}

impl CheckboxState {
    /// Flip the checked value and return the new state.
    pub fn toggle(&mut self) -> bool {
        self.checked = !self.checked;
        self.checked
    }
}