diff --git a/crates/midra-layout/src/gui.rs b/crates/midra-layout/src/gui.rs index 22ab1a0..b188976 100644 --- a/crates/midra-layout/src/gui.rs +++ b/crates/midra-layout/src/gui.rs @@ -11,6 +11,7 @@ use midra_layout::{AlignTarget, Alignment, Corner, Geometry, Layout, ResizeHandl pub struct Editor { settings: settings::Store, + themes_open: bool, layout: Layout, files: project_ui::FileUi, corner: Corner, @@ -168,6 +169,7 @@ impl Default for Editor { fn default() -> Self { let mut this = Self { settings: settings::Store::default(), + themes_open: false, layout: Layout::default(), files: project_ui::FileUi::default(), corner: Corner::TopRight, @@ -225,6 +227,7 @@ impl Editor { store: settings::Store, saved: settings::Settings, ) -> Self { + theme::Theme::restore_recent(ctx, saved.recent_themes.clone()); saved.theme.apply(ctx); Self { settings: store, @@ -237,6 +240,7 @@ impl Editor { fn application_settings(&self, ctx: &egui::Context) -> settings::Settings { settings::Settings { theme: theme::Theme::current(ctx), + recent_themes: theme::Theme::recent(ctx), keep_aspect_ratio: self.keep_aspect_ratio, show_source_pattern: self.show_pattern, show_toolbar_icon_names: self.show_toolbar_icon_names, @@ -2246,6 +2250,7 @@ impl Editor { self.output_window(ctx); self.formats_window(ctx); self.project_windows(ctx); + self.theme_window(ctx); } } diff --git a/crates/midra-layout/src/menu_ui.rs b/crates/midra-layout/src/menu_ui.rs index e1d4e32..c11534a 100644 --- a/crates/midra-layout/src/menu_ui.rs +++ b/crates/midra-layout/src/menu_ui.rs @@ -43,7 +43,7 @@ impl Editor { let before = self.application_settings(ui.ctx()); let current = theme::Theme::current(ui.ctx()); ui.menu_button(format!("Theme: {}", current.name()), |ui| { - for choice in theme::Theme::ALL { + for choice in theme::Theme::recent(ui.ctx()) { if ui .selectable_label(current == choice, choice.name()) .clicked() @@ -52,6 +52,11 @@ impl Editor { ui.close_menu(); } } + ui.separator(); + if ui.button("More themes…").clicked() { + self.themes_open = true; + ui.close_menu(); + } }); ui.separator(); ui.checkbox(&mut self.show_toolbar_icon_names, "Show toolbar icon names"); @@ -79,6 +84,50 @@ impl Editor { } } } + pub(super) fn theme_window(&mut self, ctx: &egui::Context) { + if !self.themes_open { + return; + } + let current = theme::Theme::current(ctx); + let mut selected = None; + egui::Window::new("All themes") + .open(&mut self.themes_open) + .default_width(540.0) + .resizable(false) + .collapsible(false) + .show(ctx, |ui| { + ui.label("Choose a theme. Your three most recent choices stay in the menu."); + ui.separator(); + ui.columns(2, |columns| { + for (index, choice) in theme::Theme::ALL.into_iter().enumerate() { + columns[index % 2].horizontal(|ui| { + let palette = choice.palette(); + for color in [palette.bg, palette.layer, palette.cyan] { + let (rect, _) = + ui.allocate_exact_size(Vec2::splat(10.0), egui::Sense::hover()); + ui.painter().rect_filled(rect, 2.0, color); + } + if ui + .selectable_label(current == choice, choice.name()) + .on_hover_text(if choice.is_light() { + "Light theme" + } else { + "Dark theme" + }) + .clicked() + { + selected = Some(choice); + } + }); + } + }); + }); + if let Some(choice) = selected { + choice.apply(ctx); + self.themes_open = false; + self.settings.save(&self.application_settings(ctx)); + } + } pub(super) fn fit_screen(&mut self) { self.zoom = 1.0; self.pan = Vec2::ZERO; @@ -242,11 +291,16 @@ mod tests { click_label(&mut app, &ctx, label); } click_label(&mut app, &ctx, "Theme: Midra Dark"); + click_label(&mut app, &ctx, "More themes…"); click_label(&mut app, &ctx, "Corporate Light"); let (store, saved) = settings::Store::at(path); assert!(store.error.is_none()); let fresh_ctx = egui::Context::default(); let restored = Editor::with_settings(&fresh_ctx, store, saved); + assert_eq!( + theme::Theme::recent(&fresh_ctx), + vec![theme::Theme::CorporateLight, theme::Theme::Midra] + ); assert!(restored.show_toolbar_icon_names); assert!(!restored.keep_aspect_ratio); assert!(restored.show_pattern); @@ -266,12 +320,10 @@ mod tests { click_label(&mut app, &ctx, "Options"); let label = format!("Theme: {}", theme::Theme::current(&ctx).name()); click_label(&mut app, &ctx, &label); + click_label(&mut app, &ctx, "More themes…"); click_label(&mut app, &ctx, choice.name()); assert!(theme::Theme::current(&ctx) == choice); - assert_eq!( - ctx.style().visuals.dark_mode, - choice != theme::Theme::CorporateLight - ); + assert_eq!(ctx.style().visuals.dark_mode, !choice.is_light()); let output = frame(&mut app, &ctx, vec![]); for fill in [ choice.palette().bg, diff --git a/crates/midra-layout/src/settings.rs b/crates/midra-layout/src/settings.rs index b6f1a59..5be1fec 100644 --- a/crates/midra-layout/src/settings.rs +++ b/crates/midra-layout/src/settings.rs @@ -8,6 +8,7 @@ use std::{io::Read, path::PathBuf}; pub struct Settings { pub version: u32, pub theme: Theme, + pub recent_themes: Vec, pub show_toolbar_icon_names: bool, pub keep_aspect_ratio: bool, pub show_source_pattern: bool, @@ -15,8 +16,9 @@ pub struct Settings { impl Default for Settings { fn default() -> Self { Self { - version: 1, + version: 2, theme: Theme::Midra, + recent_themes: vec![Theme::Midra], show_toolbar_icon_names: false, keep_aspect_ratio: true, show_source_pattern: false, @@ -24,6 +26,47 @@ impl Default for Settings { } } +impl Settings { + fn parse(text: &str) -> Result { + let mut value: serde_json::Value = serde_json::from_str(text).map_err(|e| e.to_string())?; + if value["version"] == 1 { + if value.get("recent_themes").is_some() { + return Err("Unexpected recent_themes in version 1 settings".into()); + } + let theme: Theme = + serde_json::from_value(value["theme"].clone()).map_err(|e| e.to_string())?; + if !matches!( + theme, + Theme::Midra | Theme::FoxifiedDark | Theme::CorporateLight + ) { + return Err("Unsupported theme in version 1 settings".into()); + } + value["recent_themes"] = serde_json::json!([theme]); + value["version"] = 2.into(); + } + let settings: Self = serde_json::from_value(value).map_err(|e| e.to_string())?; + settings.validate()?; + Ok(settings) + } + fn validate(&self) -> Result<(), String> { + if self.version != 2 { + return Err(format!("unsupported settings version {}", self.version)); + } + if self.recent_themes.is_empty() + || self.recent_themes.len() > 3 + || self.recent_themes[0] != self.theme + || self + .recent_themes + .iter() + .enumerate() + .any(|(i, t)| self.recent_themes[..i].contains(t)) + { + return Err("recent_themes must contain 1–3 unique themes, current theme first".into()); + } + Ok(()) + } +} + /// No filesystem access from Default: headless editor tests stay isolated. #[derive(Default)] pub struct Store { @@ -78,12 +121,9 @@ impl Store { if text.len() > 65_536 { return Err("settings exceed 64 KiB".into()); } - let settings: Settings = serde_json::from_str(&text).map_err(|e| e.to_string())?; - if settings.version != 1 { - return Err(format!("unsupported settings version {}", settings.version)); - } - Ok(settings) + Settings::parse(&text) } + pub fn save(&mut self, settings: &Settings) { if !self.writable { return; @@ -92,6 +132,7 @@ impl Store { return; }; let result = (|| { + settings.validate()?; let parent = path .parent() .ok_or("Settings path has no parent directory")?; @@ -122,6 +163,7 @@ mod tests { assert_eq!(settings, Settings::default()); assert!(!path.exists()); settings.theme = Theme::CorporateLight; + settings.recent_themes = vec![Theme::CorporateLight, Theme::Midra]; settings.show_toolbar_icon_names = true; settings.keep_aspect_ratio = false; settings.show_source_pattern = true; @@ -129,6 +171,7 @@ mod tests { assert!(store.error.is_none()); assert_eq!(Store::at(path.clone()).1, settings); settings.theme = Theme::FoxifiedDark; + settings.recent_themes = vec![Theme::FoxifiedDark, Theme::CorporateLight, Theme::Midra]; store.save(&settings); assert_eq!(Store::at(path.clone()).1, settings); assert_eq!( @@ -143,7 +186,7 @@ mod tests { for text in [ "broken".to_string(), serde_json::to_string(&Settings { - version: 2, + version: 3, ..Default::default() }) .unwrap(), @@ -171,9 +214,27 @@ mod tests { fn documented_settings_match_defaults() { let example = include_str!("../../../docs/interfaces/midra-layout-settings-v1.example.json"); - assert_eq!( - serde_json::from_str::(example).unwrap(), - Settings::default() - ); + assert_eq!(Settings::parse(example).unwrap(), Settings::default()); + } + #[test] + fn version_two_recent_history_is_strict_and_version_one_migrates() { + let example = + include_str!("../../../docs/interfaces/midra-layout-settings-v2.example.json"); + assert_eq!(Settings::parse(example).unwrap(), Settings::default()); + let legacy = include_str!("../../../docs/interfaces/midra-layout-settings-v1.example.json") + .replace("midra", "foxified_dark"); + let migrated = Settings::parse(&legacy).unwrap(); + assert_eq!(migrated.theme, Theme::FoxifiedDark); + assert_eq!(migrated.recent_themes, vec![Theme::FoxifiedDark]); + for recent in [ + serde_json::json!([]), + serde_json::json!(["midra", "midra"]), + serde_json::json!(["bluecore"]), + serde_json::json!(["midra", "bluecore", "hci", "solarized"]), + ] { + let mut value: serde_json::Value = serde_json::from_str(example).unwrap(); + value["recent_themes"] = recent; + assert!(Settings::parse(&value.to_string()).is_err()); + } } } diff --git a/crates/midra-layout/src/theme.rs b/crates/midra-layout/src/theme.rs index b56885d..32f2278 100644 --- a/crates/midra-layout/src/theme.rs +++ b/crates/midra-layout/src/theme.rs @@ -8,6 +8,22 @@ pub enum Theme { Midra, FoxifiedDark, CorporateLight, + Bluecore, + DupontMonsanto, + EdenGreen, + FoxifiedLight, + Hci, + IronDocks, + Peaceframe, + Rebel, + SiriusMind, + Solarized, + SonsOfBanard, + StormPilot, + TessierAshpol, + Ustf, + VerdantRebel, + WeicatIndustrial, } #[derive(Clone, Copy)] @@ -29,14 +45,67 @@ pub struct Palette { } impl Theme { - pub const ALL: [Self; 3] = [Self::Midra, Self::FoxifiedDark, Self::CorporateLight]; + pub const ALL: [Self; 19] = [ + Self::Midra, + Self::FoxifiedDark, + Self::CorporateLight, + Self::Bluecore, + Self::DupontMonsanto, + Self::EdenGreen, + Self::FoxifiedLight, + Self::Hci, + Self::IronDocks, + Self::Peaceframe, + Self::Rebel, + Self::SiriusMind, + Self::Solarized, + Self::SonsOfBanard, + Self::StormPilot, + Self::TessierAshpol, + Self::Ustf, + Self::VerdantRebel, + Self::WeicatIndustrial, + ]; pub fn name(self) -> &'static str { match self { Self::Midra => "Midra Dark", Self::FoxifiedDark => "Foxified Dark", Self::CorporateLight => "Corporate Light", + Self::Bluecore => "Bluecore", + Self::DupontMonsanto => "Dupont Monsanto", + Self::EdenGreen => "Eden Green", + Self::FoxifiedLight => "Foxified Light", + Self::Hci => "HCI", + Self::IronDocks => "Iron Docks", + Self::Peaceframe => "Peaceframe", + Self::Rebel => "Rebel", + Self::SiriusMind => "Sirius Mind", + Self::Solarized => "Solarized", + Self::SonsOfBanard => "Sons Of Banard", + Self::StormPilot => "Storm Pilot", + Self::TessierAshpol => "Tessier Ashpol", + Self::Ustf => "USTF", + Self::VerdantRebel => "Verdant Rebel", + Self::WeicatIndustrial => "Weicat Industrial", } } + pub fn is_light(self) -> bool { + matches!( + self, + Self::CorporateLight + | Self::FoxifiedLight + | Self::Hci + | Self::Peaceframe + | Self::Solarized + ) + } + pub fn recent(ctx: &egui::Context) -> Vec { + ctx.data(|d| d.get_temp(egui::Id::new("recent-themes"))) + .unwrap_or_else(|| vec![Self::current(ctx)]) + } + pub fn restore_recent(ctx: &egui::Context, recent: Vec) { + ctx.data_mut(|d| d.insert_temp(egui::Id::new("recent-themes"), recent)); + } pub fn current(ctx: &egui::Context) -> Self { ctx.data(|d| { d.get_temp(egui::Id::new("application-theme")) @@ -46,6 +115,102 @@ impl Theme { pub fn palette(self) -> Palette { let rgb = |hex: u32| Color32::from_rgb((hex >> 16) as u8, (hex >> 8) as u8, hex as u8); match self { + Self::Bluecore => sotv_palette( + [ + 0x1a222d, 0x232f3a, 0x111922, 0x2b3948, 0xd0e4ff, 0xaaccee, 0x3399ff, 0x4488cc, + ], + false, + ), + Self::DupontMonsanto => sotv_palette( + [ + 0x1f2c1a, 0x2f3d26, 0x141c10, 0x3d4f2e, 0xeaffcc, 0xd5e6aa, 0x697513, 0xbbdd44, + ], + false, + ), + Self::EdenGreen => sotv_palette( + [ + 0x1c2b1a, 0x263f25, 0x152017, 0x2f4a2b, 0xcceebb, 0xbbddaa, 0x6da436, 0x66aa55, + ], + false, + ), + Self::FoxifiedLight => sotv_palette( + [ + 0xfff8f2, 0xfff0e6, 0xffe5d0, 0xffd6b3, 0x5a2e0c, 0xaa6033, 0xff8330, 0xcc7744, + ], + true, + ), + Self::Hci => sotv_palette( + [ + 0xf2f9f6, 0xe3f0eb, 0xd0e4dd, 0xc6e8de, 0x144d40, 0x226658, 0x33ccaa, 0x66ccb3, + ], + true, + ), + Self::IronDocks => sotv_palette( + [ + 0x1e1e1e, 0x2b2b2b, 0x121212, 0x3a3a3a, 0xe0e0e0, 0xcccccc, 0xe17100, 0xaaaaaa, + ], + false, + ), + Self::Peaceframe => sotv_palette( + [ + 0xe8f3fb, 0xd4e8f5, 0xbcd9eb, 0xcbe2f2, 0x1c3f55, 0x345f77, 0x3399cc, 0x77aac6, + ], + true, + ), + Self::Rebel => sotv_palette( + [ + 0x1a1a1a, 0x2a2a2a, 0x111111, 0x444444, 0xf5f5f5, 0xaaaaaa, 0x555555, 0x666666, + ], + false, + ), + Self::SiriusMind => sotv_palette( + [ + 0x0e1a2b, 0x162538, 0x0a121d, 0x1f2f47, 0xd0e6ff, 0xaaccee, 0x3d77b1, 0x4477aa, + ], + false, + ), + Self::Solarized => sotv_palette( + [ + 0xfdf6e3, 0xfefcea, 0xeee8d5, 0xeee8d5, 0x586e75, 0xa0b1b7, 0x516a73, 0xcccccc, + ], + true, + ), + Self::SonsOfBanard => sotv_palette( + [ + 0x1e1c18, 0x2c2a26, 0x121110, 0x3a3832, 0xf0d9b5, 0xe0c8a0, 0xbd7c20, 0xcc9966, + ], + false, + ), + Self::StormPilot => sotv_palette( + [ + 0x101022, 0x1b1b33, 0x080818, 0x2b2b4a, 0xccddff, 0xaabbee, 0x5d5d82, 0x5577aa, + ], + false, + ), + Self::TessierAshpol => sotv_palette( + [ + 0x12171b, 0x1a2025, 0x0e1215, 0x202830, 0xccf2ff, 0xb0d8e6, 0x4e8ca0, 0x77cce0, + ], + false, + ), + Self::Ustf => sotv_palette( + [ + 0x0f1b2b, 0x162536, 0x0a121f, 0x1e2e44, 0xe0e8f0, 0xf2f2f2, 0xff4444, 0x446688, + ], + false, + ), + Self::VerdantRebel => sotv_palette( + [ + 0x1b2a1b, 0x273a27, 0x141d14, 0x314f31, 0xccffd9, 0xaaffcc, 0x00aa72, 0x66dd99, + ], + false, + ), + Self::WeicatIndustrial => sotv_palette( + [ + 0x1c1a14, 0x2a261d, 0x0f0e0a, 0x3a341e, 0xfff5cc, 0xffeb99, 0x8f7511, 0xe6b800, + ], + false, + ), Self::Midra => Palette { canvas: rgb(0x142d40), banner: rgb(0x264556), @@ -97,8 +262,13 @@ impl Theme { } } pub fn apply(self, ctx: &egui::Context) { + let mut recent = Self::recent(ctx); + recent.retain(|theme| *theme != self); + recent.insert(0, self); + recent.truncate(3); + Self::restore_recent(ctx, recent); let p = self.palette(); - let mut v = if self == Self::CorporateLight { + let mut v = if self.is_light() { egui::Visuals::light() } else { egui::Visuals::dark() @@ -112,7 +282,7 @@ impl Theme { v.code_bg_color = p.field; v.hyperlink_color = p.cyan; v.warn_fg_color = p.amber; - v.error_fg_color = if self == Self::CorporateLight { + v.error_fg_color = if self.is_light() { Color32::from_rgb(165, 30, 40) } else { Color32::LIGHT_RED @@ -140,3 +310,68 @@ impl Theme { pub fn palette(ctx: &egui::Context) -> Palette { Theme::current(ctx).palette() } + +// SOTV CSS tokens: body, panel, sidebar, tab, main/subtle text, button, border. +// Keep the original hues while adapting action fills for readable text. +fn sotv_palette(colors: [u32; 8], light: bool) -> Palette { + let [bg, panel, field, layer, text, subtle, accent, line] = + colors.map(|hex| Color32::from_rgb((hex >> 16) as u8, (hex >> 8) as u8, hex as u8)); + let mix = |a: Color32, b: Color32| { + Color32::from_rgb( + ((a.r() as u16 + b.r() as u16) / 2) as u8, + ((a.g() as u16 + b.g() as u16) / 2) as u8, + ((a.b() as u16 + b.b() as u16) / 2) as u8, + ) + }; + Palette { + bg, + panel, + field, + layer, + text, + muted: if light { mix(subtle, text) } else { subtle }, + cyan: if light { mix(accent, text) } else { accent }, + amber: if light { + Color32::from_rgb(129, 86, 0) + } else { + AMBER + }, + purple: mix(accent, panel), + line, + canvas: bg, + banner: panel, + grid: mix(line, bg), + pattern: [layer, panel], + } +} + +#[cfg(test)] +mod tests { + use super::*; + #[test] + fn recent_themes_are_unique_newest_first_and_bounded() { + let ctx = egui::Context::default(); + for theme in [ + Theme::Midra, + Theme::FoxifiedDark, + Theme::CorporateLight, + Theme::Bluecore, + ] { + theme.apply(&ctx); + } + assert_eq!( + Theme::recent(&ctx), + vec![Theme::Bluecore, Theme::CorporateLight, Theme::FoxifiedDark] + ); + Theme::CorporateLight.apply(&ctx); + Theme::CorporateLight.apply(&ctx); + assert_eq!( + Theme::recent(&ctx), + vec![Theme::CorporateLight, Theme::Bluecore, Theme::FoxifiedDark] + ); + let fresh = egui::Context::default(); + Theme::restore_recent(&fresh, Theme::recent(&ctx)); + Theme::CorporateLight.apply(&fresh); + assert_eq!(Theme::recent(&fresh), Theme::recent(&ctx)); + } +} diff --git a/docs/interfaces/midra-layout-settings-v2.example.json b/docs/interfaces/midra-layout-settings-v2.example.json new file mode 100644 index 0000000..381d050 --- /dev/null +++ b/docs/interfaces/midra-layout-settings-v2.example.json @@ -0,0 +1,8 @@ +{ + "version": 2, + "theme": "midra", + "recent_themes": ["midra"], + "show_toolbar_icon_names": false, + "keep_aspect_ratio": true, + "show_source_pattern": false +} diff --git a/docs/interfaces/midra-layout-settings.md b/docs/interfaces/midra-layout-settings.md index 206501e..c63cb77 100644 --- a/docs/interfaces/midra-layout-settings.md +++ b/docs/interfaces/midra-layout-settings.md @@ -1,8 +1,11 @@ -# Midra Layout application settings, version 1 +# Midra Layout application settings, version 2 Implementation: `crates/midra-layout/src/settings.rs`. This per-user JSON file is independent of the [project JSON and SVG contracts](midra-layout.md). -[Complete default example](midra-layout-settings-v1.example.json). +[Complete default example](midra-layout-settings-v2.example.json). +Version 1 files migrate automatically: the saved theme becomes the only entry in +`recent_themes`, with all other preferences preserved. The [version 1 example](midra-layout-settings-v1.example.json) +remains a migration fixture. Saving writes version 2; old applications reject it. The `directories` 6 crate resolves `ProjectDirs::from("org", "beffroi", "midra-layout")`. The filename is `settings.json` beneath `config_dir()`: @@ -19,18 +22,21 @@ unknown theme names are rejected. There are no numeric coordinates or units. | Field | Values / default | | --- | --- | -| `version` | Integer `1` | -| `theme` | `"midra"` (default), `"foxified_dark"`, `"corporate_light"` | +| `version` | Integer `2` | +| `theme` | Theme ID from the catalog below; default `"midra"` | +| `recent_themes` | 1–3 unique theme IDs, newest first; first must equal `theme`; default `["midra"]` | | `show_toolbar_icon_names` | Boolean; default false | | `keep_aspect_ratio` | Boolean; default true | | `show_source_pattern` | Boolean; default false | Loaded once at startup before the editor appears. Explicit Options changes save -all four current preferences immediately. The directory is created lazily; +the current preferences and theme history immediately. The directory is created lazily; missing files do not trigger a write until the user changes an option. Writes use a temporary file in the same directory, file sync and atomic replacement. Multiple application instances use last-successful-write wins; no merging or -live reloading is performed. +live reloading is performed. Selecting a theme moves it to the front, removes any +previous occurrence, and trims the list to three. Starting the app does not reorder +the restored history. Opening or dismissing the full picker changes nothing. Project JSON v1/v2 remains unchanged. Opening a project can restore its embedded caption, aspect-ratio and source-preview preferences for that document; it never @@ -49,3 +55,36 @@ addresses or clipboard contents are stored. No settings are exported to SVG. Breaking or additive schema changes under this strict contract require a version bump, updated documentation/examples/tests, and either an explicit migration or an actionable unsupported-version error. + +## Bundled theme catalog + +All 18 CSS themes in `SOTV_Websites/sotv/song_database/styles/themes/` are +represented, alongside Midra Dark. Palettes are bundled in `src/theme.rs`: +no sibling checkout or CSS interpreter is required at build or runtime. Corporate +uses the website's base defaults. The existing three palettes retain their +hand-tuned viewport colors; other palettes map body/panel/sidebar/tab surfaces, +main/subtle text, button accent and border tokens into the editor. Action fills +blend accent and panel; light-theme text/accent colors are darkened for contrast. +The picker includes both light and dark themes with color swatches. + +| Theme | Settings ID | Source CSS | +| --- | --- | --- | +| Midra Dark | `midra` | Original editor palette | +| Corporate Light | `corporate_light` | `theme-corporate.css` and `../base/variables.css` | +| Foxified Dark | `foxified_dark` | `theme-foxified-dark.css` | +| Bluecore | `bluecore` | `theme-bluecore.css` | +| Dupont Monsanto | `dupont_monsanto` | `theme-dupont-monsanto.css` | +| Eden Green | `eden_green` | `theme-eden-green.css` | +| Foxified Light | `foxified_light` | `theme-foxified-light.css` | +| HCI | `hci` | `theme-hci.css` | +| Iron Docks | `iron_docks` | `theme-iron-docks.css` | +| Peaceframe | `peaceframe` | `theme-peaceframe.css` | +| Rebel | `rebel` | `theme-rebel.css` | +| Sirius Mind | `sirius_mind` | `theme-sirius-mind.css` | +| Solarized | `solarized` | `theme-solarized.css` | +| Sons Of Banard | `sons_of_banard` | `theme-sons-of-banard.css` | +| Storm Pilot | `storm_pilot` | `theme-storm-pilot.css` | +| Tessier Ashpol | `tessier_ashpol` | `theme-tessier-ashpol.css` | +| USTF | `ustf` | `theme-ustf.css` | +| Verdant Rebel | `verdant_rebel` | `theme-verdant-rebel.css` | +| Weicat Industrial | `weicat_industrial` | `theme-weicat-industrial.css` | diff --git a/docs/midra-layout.md b/docs/midra-layout.md index 88bd259..02ad44d 100644 --- a/docs/midra-layout.md +++ b/docs/midra-layout.md @@ -433,21 +433,24 @@ project; older projects open with captions off. ### Application themes -**Menu → Options → Theme** (also in the toolbar cog) offers **Midra Dark**, -**Foxified Dark**, and **Corporate Light**. Switching updates toolbar, inspector, -dialogs, fields and menus immediately. The viewport, grid, layer boxes and source test patterns use the selected palette; -selected layers remain gold (darker gold for contrast in the light theme). Imported -reference image pixels retain their original colors, with themed empty margins. -Theme choice is saved automatically per user, survives restarts and opening other -projects, and is not included in project JSON or SVG exports. +**Menu → Options → Theme** (also in the toolbar cog) shows up to three recently +used themes, newest first. **More themes…** opens the complete picker with color +swatches: Midra Dark plus all 18 themes from the SOTV song-database theme folder. +A fresh installation lists only Midra Dark until other themes are selected. +Selecting a theme updates the UI and viewport immediately and saves the recent +history across restarts. Reusing a theme moves it to the top without duplicates. +Closing the picker without choosing leaves the theme and history unchanged. -The additional palettes are adapted from the sibling `SOTV_Websites` project's -`sotv/song_database/styles/themes/theme-foxified-dark.css` and -`styles/base/variables.css` (Corporate Light, selected by -`styles/themes/theme-corporate.css`). Foxified preserves its brown surfaces, -peach text and orange accent. Corporate preserves its neutral light surfaces; -muted text, warnings and accent colors are darkened for readable contrast. -Action fills are adapted for readable button text in both themes. +The viewport, grid, layer boxes and source test patterns use the selected palette; +selected layers remain gold (darker gold for contrast in light themes). Imported +reference images retain their colors. Theme and history survive opening projects +and are not included in project JSON or SVG exports. + +The SOTV palettes are bundled with the app from +`sotv/song_database/styles/themes/` in the sibling `SOTV_Websites` repository; +Corporate Light uses `styles/base/variables.css`. No sibling repository is needed +to build or run Midra Layout. See the [theme catalog and settings contract](interfaces/midra-layout-settings.md) +for names, source files, stable IDs and palette adaptations. ### Saved application options