asked the clanker to change the arcidecture a bit

This commit is contained in:
2026-09-09 15:50:07 +01:00
parent 3490af52e4
commit b9c7e73824
15 changed files with 185 additions and 74 deletions
+2 -1
View File
@@ -9,5 +9,6 @@ path = "src/lib.rs"
[dependencies]
common = { path = "../../common" }
service_datatime = { package = "service-datatime", path = "../../services/datatime" }
iced = { workspace = true }
thiserror = { workspace = true }
toml = { workspace = true }
+16
View File
@@ -11,6 +11,14 @@ use common::{BarModule, ClockKind, ClockPayload, ModuleEffect, ModuleMsg, Servic
const POPUP_W: u32 = 360;
const POPUP_H: u32 = 160;
/// Errors digesting the `module.clock` config table.
#[derive(Debug, thiserror::Error)]
pub enum ClockError {
/// Config value was present but not a bool.
#[error("module.clock.{0} must be a bool")]
NotBool(&'static str),
}
/// A module-local message for the clock.
#[derive(Clone)]
pub enum ClockMsg {
@@ -100,4 +108,12 @@ impl BarModule for Clock {
fn popup_size(&self) -> Option<(u32, u32)> {
Some((POPUP_W, POPUP_H))
}
fn config(&mut self, config: toml::Table) -> Result<(), Box<dyn std::error::Error>> {
if let toml::Value::Boolean(e) = config["format"] {
if e {
self.show_seconds = true;
};
}
Ok(())
}
}