Select Color: one fixed colour book folder instead of a folder list setting

The color_book_dirs setting is gone. Colour books live in color_books in
the config folder (book::folder()), like the other fixed locations;
Options > Files shows it through Folders::color_books. read_all() and
load_from_dialog() use that folder directly.

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 20:15:53 +00:00
1 parent a9d8d4b531
commit 6e05c7e2e5
7 files changed
+47 -72

No files matched your search

+5 -9
View File
@@ -11935,9 +11935,7 @@ impl OpenCADStudio {
self.update(Message::ColorWindowPick(color, name))
}
Some(crate::ui::color_select::Outcome::LoadBook) => Task::perform(
crate::ui::color_select::book::load_from_dialog(
self.color_book_dirs.first().cloned(),
),
crate::ui::color_select::book::load_from_dialog(),
Message::ColorBookLoaded,
),
Some(crate::ui::color_select::Outcome::Cancel) => {
@@ -12070,16 +12068,14 @@ impl OpenCADStudio {
document.layers.get(layer).map(|layer| layer.color)
}
/// Read the built-in colour books and every `.acb` in the colour book
/// folders, once until the folders change. A book in a folder replaces a
/// built-in one of the same name.
/// Read the built-in colour book and every `.acb` in the colour book
/// folder, once per session. A book in the folder replaces a built-in
/// one of the same name.
fn read_color_books(&mut self) {
if std::mem::replace(&mut self.color_books_read, true) {
return;
}
self.color_books = std::sync::Arc::new(crate::ui::color_select::book::read_all(
&self.color_book_dirs,
));
self.color_books = std::sync::Arc::new(crate::ui::color_select::book::read_all());
}
/// Colour the selected objects (or set the current colour when nothing