Select Color: colour book folders, app-style view toggles, load button by the book list

- Colour books now come from folders, like AutoCAD's Color Book
  Locations: Options > Files lists them (add, open, remove); by default
  one color_books folder in the config directory. The Color Books tab
  shows the built-in books plus every .acb in those folders; Load copies
  the chosen file into the first folder. Web: session only, as before.
- Grid/list buttons use the app's toggle style (light accent, its text
  colour for the icon, same corners as inactive).
- Color Books: the load button sits right of the book list; the search
  box keeps its start over the page strip and runs to the end.
- Translations for the two new Options strings in all 22 locales.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013rGmDUNr1hUf4zo1X3dak8
This commit is contained in:
Claude committed 2026-10-14 18:51:02 +00:00
1 parent 322c1906f9
commit 666234f69e
30 files changed
+222 -61

No files matched your search

+11 -5
View File
@@ -965,9 +965,10 @@ pub(super) struct OpenCADStudio {
// ── Floating panel windows ────────────────────────────────────────────
/// The open Select Color panel, if any.
color_picker: Option<crate::ui::color_select::ColorPicker>,
/// Colour books loaded this session, read lazily from `color_book_paths`.
/// The built-in colour books and those in `color_book_dirs`, read
/// lazily when the Select Color panel opens.
color_books: std::sync::Arc<Vec<crate::ui::color_select::book::ColorBook>>,
color_book_paths: Vec<String>,
color_book_dirs: Vec<String>,
color_books_read: bool,
/// Recently committed real colours, newest first.
/// ACI and True Color remain semantically distinct even when their RGB matches.
@@ -4174,8 +4175,13 @@ pub enum Message {
/// Commit the colour chosen in the shared picker, with its `BOOK$NAME`
/// when it comes from a colour book.
ColorWindowPick(codec::types::Color, Option<String>),
/// An `.acb` file was read: the book and, on desktop, where it lives.
ColorBookLoaded(Result<(crate::ui::color_select::book::ColorBook, Option<String>), String>),
/// An `.acb` file was read (and, on desktop, copied into the first
/// colour book folder).
ColorBookLoaded(Result<crate::ui::color_select::book::ColorBook, String>),
/// Options › Files: pick a folder to search for colour books.
ColorBookDirBrowse,
ColorBookDirAdd(String),
ColorBookDirRemove(usize),
/// Set a block/linetype Handle field on the selected dim style from a
/// dropdown of available block-records / linetypes (by name).
DsSetHandle {
@@ -4608,7 +4614,7 @@ impl OpenCADStudio {
web_autosave_clear_after: Vec::new(),
color_picker: None,
color_books: Default::default(),
color_book_paths: Vec::new(),
color_book_dirs: Vec::new(),
color_books_read: false,
active_modal: None,
hyperlink_editor_handles: Vec::new(),