Document Settings: design units (document.units: mm, cm, m, in, ft; values keep their meaning) from the browser's Units row, display precision row; new designs take the preferred units; the Properties window shows lengths, areas and volumes in the design's units with the chosen precision
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
c99e7e41ec
commit
13070abc55
6 files changed
+127
-17
No files matched your search
@@ -558,7 +558,19 @@ fn doc_settings(app: &mut SolveApp, ui: &mut egui::Ui, depth: usize) {
|
||||
return;
|
||||
}
|
||||
let units = format!("Units: {}", app.session.doc.units);
|
||||
draw_row(ui, ui.id().with("units"), &Row { depth: depth + 1, icon: "settings", label: &units, ..Default::default() });
|
||||
let r = draw_row(ui, ui.id().with("units"), &Row { depth: depth + 1, icon: "settings", label: &units, ..Default::default() });
|
||||
if let Some(p) = r.secondary.or(r.clicked.then(|| r.rect.map(|x| x.left_bottom())).flatten()) {
|
||||
crate::context_menu::open_for(app, p, Target::Units);
|
||||
}
|
||||
let prec = format!(
|
||||
"Precision: {} {}, {}°",
|
||||
format_args!("{:.*}", usize::from(app.preferences.length_decimals), 0.0),
|
||||
crate::prefs::unit_scale(&app.session.doc.units).1,
|
||||
format_args!("{:.*}", usize::from(app.preferences.angle_decimals), 0.0)
|
||||
);
|
||||
if draw_row(ui, ui.id().with("precision"), &Row { depth: depth + 1, icon: "settings", label: &prec, ..Default::default() }).clicked {
|
||||
app.prefs_window.open = true;
|
||||
}
|
||||
let params = format!("Parameters ({})", app.session.doc.params.len());
|
||||
if draw_row(ui, ui.id().with("params"), &Row { depth: depth + 1, icon: "params", label: ¶ms, ..Default::default() }).clicked {
|
||||
app.start("ChangeParameterCommand");
|
||||
|
||||
Reference in new issue
Block a user