Add theme-aware notification cards with grouped popup stacks
This commit is contained in:
1 parent
45a9c0384c
commit
a98d7a75c3
7 files changed
+1558
-3
No files matched your search
@@ -1,4 +1,5 @@
|
||||
pub mod desktop;
|
||||
pub mod notifications;
|
||||
mod output;
|
||||
mod workspace;
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, PartialEq, Eq)]
|
||||
#[serde(default, deny_unknown_fields)]
|
||||
pub struct NotificationConfig {
|
||||
pub show_popups: bool,
|
||||
pub do_not_disturb: bool,
|
||||
pub timeout_ms: u32,
|
||||
}
|
||||
|
||||
impl Default for NotificationConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
show_popups: true,
|
||||
do_not_disturb: false,
|
||||
timeout_ms: 6000,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl NotificationConfig {
|
||||
pub fn validate(&self) -> Result<(), String> {
|
||||
if !(1000..=30000).contains(&self.timeout_ms) {
|
||||
return Err("notifications.timeout_ms must be between 1000 and 30000".into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user