#[derive(Debug, Clone, PartialEq)]
pub enum WidgetState {
Normal,
Hovered,
Selected,
Editing(EditingKind),
}
impl Default for WidgetState {
fn default() -> Self {
Self::Normal
}
}
impl WidgetState {
pub fn is_selected(&self) -> bool {
matches!(self, Self::Selected | Self::Editing(_))
}
pub fn is_editing(&self) -> bool {
matches!(self, Self::Editing(_))
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum EditingKind {
Text,
Path,
}