max / makeover
1 file changed,
+6 insertions,
-6 deletions
| @@ -11,7 +11,7 @@ use theme_common::{load_theme, list_themes_from_dirs, dev_themes_dir}; | |||
| 11 | 11 | use std::path::PathBuf; | |
| 12 | 12 | ||
| 13 | 13 | // Set up theme directories (later entries override earlier ones) | |
| 14 | - | let bundled = PathBuf::from("/path/to/Shared/themes"); | |
| 14 | + | let bundled = PathBuf::from("/path/to/MNW/shared/themes"); | |
| 15 | 15 | let custom = PathBuf::from("/path/to/user/custom-themes"); | |
| 16 | 16 | let dirs = vec![(bundled, false), (custom, true)]; | |
| 17 | 17 | ||
| @@ -27,9 +27,9 @@ println!("Name: {}", theme.meta.name); // "Catppuccin Mocha" | |||
| 27 | 27 | println!("Variant: {}", theme.meta.variant); // "dark" | |
| 28 | 28 | println!("BG: {}", theme.colors["background.primary"]); // "#181825" | |
| 29 | 29 | ||
| 30 | - | // Dev helper: find Shared/themes/ relative to CARGO_MANIFEST_DIR | |
| 31 | - | if let Some(dev_dir) = dev_themes_dir(Path::new(env!("CARGO_MANIFEST_DIR")), 2) { | |
| 32 | - | // dev_dir = .../Code/Shared/themes | |
| 30 | + | // Dev helper: find MNW/shared/themes/ relative to CARGO_MANIFEST_DIR | |
| 31 | + | if let Some(dev_dir) = dev_themes_dir(Path::new(env!("CARGO_MANIFEST_DIR")), 3) { | |
| 32 | + | // dev_dir = .../Code/MNW/shared/themes | |
| 33 | 33 | } | |
| 34 | 34 | ``` | |
| 35 | 35 | ||
| @@ -95,14 +95,14 @@ The theme ID is the filename without `.toml` (e.g., `catppuccin-mocha.toml` has | |||
| 95 | 95 | | `parse_meta(id, table, is_custom)` | Parse `[meta]` from a TOML table into `ThemeMeta` | | |
| 96 | 96 | | `extract_colors(table)` | Flatten color sections into a `HashMap<String, String>` | | |
| 97 | 97 | | `validate_theme_id(id)` | Check that an ID contains only safe characters | | |
| 98 | - | | `dev_themes_dir(manifest_dir, levels)` | Walk up parent directories to find `Shared/themes/` (dev convenience) | | |
| 98 | + | | `dev_themes_dir(manifest_dir, levels)` | Walk up parent directories to find `MNW/shared/themes/` (dev convenience) | | |
| 99 | 99 | ||
| 100 | 100 | ## Directory Priority | |
| 101 | 101 | ||
| 102 | 102 | `list_themes_from_dirs` and `load_theme` accept a list of `(PathBuf, bool)` pairs. Later directories override earlier ones by theme ID. The `bool` marks whether the directory contains user-custom themes (`is_custom` on `ThemeMeta`). | |
| 103 | 103 | ||
| 104 | 104 | Typical setup for a Tauri app: | |
| 105 | - | 1. Bundled themes from `Shared/themes/` (is_custom = false) | |
| 105 | + | 1. Bundled themes from `MNW/shared/themes/` (is_custom = false) | |
| 106 | 106 | 2. User themes from an app data directory (is_custom = true) | |
| 107 | 107 | ||
| 108 | 108 | ## License |