forked from 1b-agent/opencadstudio-upstream
Options: color book folder shown like the other locations
Options > Files lists the color book folder as a read-only row with Open folder, like Plot styles or Fonts. The Add folder / Remove buttons, their messages and the explanatory line (in all 22 locales) are gone; the folder list stays in the settings for a later location option. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013rGmDUNr1hUf4zo1X3dak8
This commit is contained in:
26 files changed
+7
-100
No files matched your search
@@ -4341,10 +4341,6 @@ pub enum Message {
|
||||
/// 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 {
|
||||
|
||||
@@ -11993,35 +11993,6 @@ impl OpenCADStudio {
|
||||
}
|
||||
Task::none()
|
||||
}
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
Message::ColorBookDirBrowse => Task::perform(
|
||||
async {
|
||||
crate::sys::file_dialog()
|
||||
.pick_folder()
|
||||
.await
|
||||
.map(|handle| crate::sys::handle_path(&handle).display().to_string())
|
||||
},
|
||||
|dir| dir.map_or(Message::Noop, Message::ColorBookDirAdd),
|
||||
),
|
||||
// Browsers expose no folder picker.
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
Message::ColorBookDirBrowse => Task::none(),
|
||||
Message::ColorBookDirAdd(dir) => {
|
||||
if !self.color_book_dirs.contains(&dir) {
|
||||
self.color_book_dirs.push(dir);
|
||||
self.color_books_read = false;
|
||||
self.persist_settings_if_changed();
|
||||
}
|
||||
Task::none()
|
||||
}
|
||||
Message::ColorBookDirRemove(i) => {
|
||||
if i < self.color_book_dirs.len() {
|
||||
self.color_book_dirs.remove(i);
|
||||
self.color_books_read = false;
|
||||
self.persist_settings_if_changed();
|
||||
}
|
||||
Task::none()
|
||||
}
|
||||
Message::DsSetHandle { field, value } => self.on_ds_set_handle(field, value),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user