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
View File
@@ -868,7 +868,6 @@ impl OpenCADStudio {
block_recent: self.block_palette.recent.clone(),
block_favorites: self.block_palette.favorites.clone(),
block_libraries: self.block_palette.libraries.clone(),
color_book_dirs: self.color_book_dirs.clone(),
block_palette_view: self.block_palette.view as u8,
block_insert: self.block_palette.options.clone(),
block_mru_list: self.block_mru_list,
@@ -1047,10 +1046,6 @@ impl OpenCADStudio {
self.block_palette.recent = s.block_recent.clone();
self.block_palette.favorites = s.block_favorites.clone();
self.block_palette.libraries = s.block_libraries.clone();
if self.color_book_dirs != s.color_book_dirs {
self.color_book_dirs = s.color_book_dirs.clone();
self.color_books_read = false;
}
self.block_palette.view =
crate::ui::window::block_palette::ViewMode::from_u8(s.block_palette_view);
self.block_palette.set_options(s.block_insert.clone());
+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