feat: add accordion overlay controls and icon API
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use crate::countdown::events::AppEvent;
|
||||
use crate::countdown::service::CountdownService;
|
||||
use std::collections::HashMap;
|
||||
use tokio::sync::broadcast;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -28,11 +29,30 @@ impl ClockAnchor {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct OverlayConfig {
|
||||
pub icon: String,
|
||||
pub text_color: String,
|
||||
pub bg_color: String,
|
||||
}
|
||||
|
||||
impl Default for OverlayConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
icon: String::new(),
|
||||
text_color: "white".to_string(),
|
||||
bg_color: "transparent".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct AppState {
|
||||
pub clock_anchor: ClockAnchor,
|
||||
pub countdown_service: CountdownService,
|
||||
pub event_bus: broadcast::Sender<AppEvent>,
|
||||
pub overlay_configs: tokio::sync::Mutex<HashMap<u64, OverlayConfig>>,
|
||||
}
|
||||
|
||||
impl AppState {
|
||||
@@ -42,6 +62,7 @@ impl AppState {
|
||||
clock_anchor: ClockAnchor::new(),
|
||||
countdown_service: CountdownService::new(),
|
||||
event_bus,
|
||||
overlay_configs: tokio::sync::Mutex::new(HashMap::new()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user