#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum DecorationsMode {
#[default]
Native,
CustomChrome,
None,
}
impl DecorationsMode {
pub fn wants_custom_chrome_host(self) -> bool {
matches!(self, DecorationsMode::CustomChrome)
}
pub fn wants_native_decorations(self) -> bool {
matches!(self, DecorationsMode::Native)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn default_is_native() {
assert_eq!(DecorationsMode::default(), DecorationsMode::Native);
}
#[test]
fn predicates() {
assert!(DecorationsMode::Native.wants_native_decorations());
assert!(!DecorationsMode::Native.wants_custom_chrome_host());
assert!(DecorationsMode::CustomChrome.wants_custom_chrome_host());
assert!(!DecorationsMode::CustomChrome.wants_native_decorations());
assert!(!DecorationsMode::None.wants_custom_chrome_host());
assert!(!DecorationsMode::None.wants_native_decorations());
}
}