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
@@ -1773,49 +1773,6 @@ pub fn view_window<'a>(
|
||||
.align_y(iced::Center)
|
||||
};
|
||||
|
||||
// Searched for `.acb` colour books; editable, unlike the folders above.
|
||||
// Browsers have no folders, so the web build leaves it out.
|
||||
let color_book_locations = |dirs: &'a [String]| -> Element<'a, Message> {
|
||||
if cfg!(target_arch = "wasm32") {
|
||||
return Space::new().into();
|
||||
}
|
||||
let list = dirs
|
||||
.iter()
|
||||
.enumerate()
|
||||
.fold(column![].spacing(6), |list, (i, dir)| {
|
||||
list.push(
|
||||
row![
|
||||
text(dir.as_str()).size(11).width(Fill),
|
||||
button(text(crate::t!("Open folder")).size(11))
|
||||
.padding([4, 10])
|
||||
.style(button::secondary)
|
||||
.on_press(Message::OpenFolder(dir.clone())),
|
||||
button(text(crate::t!("Remove")).size(11))
|
||||
.padding([4, 10])
|
||||
.style(button::secondary)
|
||||
.on_press(Message::ColorBookDirRemove(i)),
|
||||
]
|
||||
.spacing(10)
|
||||
.align_y(iced::Center),
|
||||
)
|
||||
});
|
||||
column![
|
||||
text(crate::t!("Color book locations")).size(12),
|
||||
text(crate::t!(
|
||||
"Folders searched for .acb color books. A book loaded in Select Color is copied into the first folder."
|
||||
))
|
||||
.size(11),
|
||||
list,
|
||||
button(text(crate::t!("Add folder…")).size(11))
|
||||
.padding([4, 10])
|
||||
.style(button::secondary)
|
||||
.on_press(Message::ColorBookDirBrowse),
|
||||
Space::new().height(16),
|
||||
]
|
||||
.spacing(6)
|
||||
.into()
|
||||
};
|
||||
|
||||
let files = column![
|
||||
text(crate::t!("Files")).size(15),
|
||||
Space::new().height(6),
|
||||
@@ -1834,8 +1791,14 @@ pub fn view_window<'a>(
|
||||
folder_row(crate::t!("Autosave files"), folders.autosave.clone()),
|
||||
Space::new().height(12),
|
||||
folder_row(crate::t!("Fonts"), folders.fonts.clone()),
|
||||
// Where `.acb` colour books are found (none on the web).
|
||||
color_book_dirs.iter().fold(column![], |rows, dir| rows
|
||||
.push(Space::new().height(12))
|
||||
.push(folder_row(
|
||||
crate::t!("Color book locations"),
|
||||
Some(dir.clone())
|
||||
))),
|
||||
Space::new().height(16),
|
||||
color_book_locations(color_book_dirs),
|
||||
text(crate::t!("Default template for new drawings")).size(12),
|
||||
Space::new().height(4),
|
||||
row![
|
||||
|
||||
Reference in new issue
Block a user