#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Action {
Increase,
Decrease,
Reset,
Dark,
Light,
Show,
Hide,
Dock,
Exit,
}
impl Action {
pub const Every:[Self; 9] = [
Self::Increase,
Self::Decrease,
Self::Reset,
Self::Dark,
Self::Light,
Self::Show,
Self::Hide,
Self::Dock,
Self::Exit,
];
pub const fn id(self) -> &'static str {
match self {
Self::Increase => "increase",
Self::Decrease => "decrease",
Self::Reset => "reset",
Self::Dark => "dark",
Self::Light => "light",
Self::Show => "show",
Self::Hide => "hide",
Self::Dock => "dock",
Self::Exit => "exit",
}
}
pub const fn label(self) -> &'static str {
match self {
Self::Increase => "Increase Size\u{2001}â",
Self::Decrease => "Decrease Size\u{2001}â",
Self::Reset => "Reset\u{2001}âŠī¸",
Self::Dark => "Dark\u{2001}đ",
Self::Light => "Light\u{2001}âī¸",
Self::Show => "Show\u{2001}đ¨đģ",
Self::Hide => "Hide\u{2001}đĨˇđŊ",
Self::Dock => "No Dock\u{2001}â",
Self::Exit => "Exit\u{2001}â",
}
}
pub fn of(id:&str) -> Option<Self> { Self::Every.into_iter().find(|action| action.id() == id) }
}