theme config, layout preview, container alignment
Server: ThemeConfig entity + CRUD (GET/PUT /theme), SQLite persistence, ThemeUpdate broadcast to ESP32 on save and initial connect. Client: render engine uses theme colors, full-screen redraw on theme change. SPA: theme page with color pickers + presets, layout preview with TS port of layout engine, justify/align controls on containers. DisplayHint refactored to struct (kind + h_align + v_align).
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use domain::{
|
||||
ConfigRepository, DataSource, DataSourceId, DataSourceValidationError, DomainEvent,
|
||||
EventPublisher, Layout, LayoutPreset, LayoutPresetId, WidgetConfig, WidgetId,
|
||||
EventPublisher, Layout, LayoutPreset, LayoutPresetId, ThemeConfig, WidgetConfig, WidgetId,
|
||||
};
|
||||
use std::fmt;
|
||||
|
||||
@@ -142,6 +142,21 @@ where
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn update_theme(
|
||||
&self,
|
||||
theme: ThemeConfig,
|
||||
) -> Result<(), ConfigError<C::Error, E::Error>> {
|
||||
self.config
|
||||
.save_theme(&theme)
|
||||
.await
|
||||
.map_err(ConfigError::Repository)?;
|
||||
self.events
|
||||
.publish(DomainEvent::ThemeChanged { theme })
|
||||
.await
|
||||
.map_err(ConfigError::Event)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn save_preset(
|
||||
&self,
|
||||
preset: LayoutPreset,
|
||||
|
||||
Reference in New Issue
Block a user