forked from 1b-agent/opencadstudio-upstream
PDF dialogs: one-line file details, only existing layers toggle
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
913c845f5b
commit
647a05e37a
2 files changed
+13
-4
No files matched your search
@@ -306,7 +306,9 @@ impl OpenCADStudio {
|
|||||||
Some(at) => {
|
Some(at) => {
|
||||||
t.hidden.remove(at);
|
t.hidden.remove(at);
|
||||||
}
|
}
|
||||||
None => t.hidden.push(layer),
|
// Only a layer the file has can be turned off.
|
||||||
|
None if t.layers.contains(&layer) => t.hidden.push(layer),
|
||||||
|
None => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,11 +261,18 @@ fn field<'a>(
|
|||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A label and a value as plain text.
|
/// A label and a value on one line; a long value keeps its end.
|
||||||
fn info_line<'a>(label: String, value: &'a str) -> Element<'a, Message> {
|
fn info_line<'a>(label: String, value: &'a str) -> Element<'a, Message> {
|
||||||
|
const MAX: usize = 70;
|
||||||
|
let count = value.chars().count();
|
||||||
|
let shown = if count > MAX {
|
||||||
|
format!("…{}", value.chars().skip(count - (MAX - 1)).collect::<String>())
|
||||||
|
} else {
|
||||||
|
value.to_string()
|
||||||
|
};
|
||||||
row![
|
row![
|
||||||
text(label).size(11).style(muted_style).width(Length::Fixed(96.0)),
|
text(label).size(11).style(muted_style).width(Length::Fixed(96.0)),
|
||||||
text(value).size(11).width(Fill),
|
text(shown).size(11).width(Fill).wrapping(iced::advanced::text::Wrapping::None),
|
||||||
]
|
]
|
||||||
.spacing(6)
|
.spacing(6)
|
||||||
.into()
|
.into()
|
||||||
@@ -499,7 +506,7 @@ pub fn view_attach<'a>(
|
|||||||
column![
|
column![
|
||||||
container(page_tiles(&state.pages, &state.selected, PdfDialogMsg::AttachPage))
|
container(page_tiles(&state.pages, &state.selected, PdfDialogMsg::AttachPage))
|
||||||
.padding(6)
|
.padding(6)
|
||||||
.height(Length::Fixed(262.0))
|
.height(Length::Fixed(226.0))
|
||||||
.width(Fill)
|
.width(Fill)
|
||||||
.style(well_style),
|
.style(well_style),
|
||||||
text(crate::tf!("Selected pages: {pages}", pages = chosen)).size(11).style(muted_style),
|
text(crate::tf!("Selected pages: {pages}", pages = chosen)).size(11).style(muted_style),
|
||||||
|
|||||||
Reference in new issue
Block a user