forked from 1b-agent/opencadstudio-upstream
Merge remote-tracking branch 'origin/main' into merge-test/main-into-constraints
# Conflicts: # src/app/command_driver.rs # src/command.rs # src/ui/ribbon/mod.rs # src/ui/window/options.rs
This commit is contained in:
commit
ad718def3f
124 files changed
+9866
-692
No files matched your search
+47
-9
@@ -2221,6 +2221,17 @@ impl OpenCADStudio {
|
||||
entity_type_label(entity)
|
||||
}
|
||||
}
|
||||
acadrust::EntityType::Surface(_)
|
||||
if matches!(
|
||||
crate::scene::model::solid_history::primitive_property_operation(
|
||||
&self.tabs[i].scene.document,
|
||||
handle,
|
||||
),
|
||||
Some(acadrust::objects::SolidHistoryOperation::Extrusion(_))
|
||||
) =>
|
||||
{
|
||||
format!("{} ({})", t!("Surface"), t!("Extrusion"))
|
||||
}
|
||||
_ => entity_type_label(entity),
|
||||
};
|
||||
ui::PropertiesPanel {
|
||||
@@ -2328,23 +2339,22 @@ filter={:.1} local={:.1} aggregate={:.1} entities={}",
|
||||
);
|
||||
}
|
||||
}
|
||||
if local_refs.iter().all(|(handle, _)| {
|
||||
let compact_solids = local_refs.iter().all(|(handle, _)| {
|
||||
crate::scene::model::solid_history::has_compact_solid_properties(
|
||||
&self.tabs[i].scene.document,
|
||||
*handle,
|
||||
)
|
||||
}) {
|
||||
sections.retain(|section| {
|
||||
!section.props.iter().any(|property| {
|
||||
property.field.starts_with("acis_")
|
||||
|| property.field.starts_with("s3d_")
|
||||
})
|
||||
});
|
||||
});
|
||||
if compact_solids {
|
||||
retain_compact_solid_sections(&mut sections);
|
||||
}
|
||||
sections.extend(aggregate_solid_history_sections(
|
||||
&self.tabs[i].scene.document,
|
||||
&local_refs.iter().map(|(handle, _)| *handle).collect::<Vec<_>>(),
|
||||
));
|
||||
if compact_solids {
|
||||
retain_compact_solid_sections(&mut sections);
|
||||
}
|
||||
ui::PropertiesPanel {
|
||||
choice_combos: sections
|
||||
.iter()
|
||||
@@ -3293,6 +3303,10 @@ fn retain_compact_solid_sections(
|
||||
sections: &mut Vec<crate::scene::model::object::PropSection>,
|
||||
) {
|
||||
sections.iter_mut().for_each(|section| {
|
||||
let internal_surface_section = section
|
||||
.props
|
||||
.iter()
|
||||
.any(|property| property.field == "srf_kind");
|
||||
section.props.retain(|property| {
|
||||
matches!(
|
||||
property.field,
|
||||
@@ -3305,7 +3319,8 @@ fn retain_compact_solid_sections(
|
||||
| "transparency"
|
||||
| "hyperlink"
|
||||
| "material"
|
||||
) || crate::scene::model::solid_history::is_specialized_property(property.field)
|
||||
) || (!internal_surface_section
|
||||
&& crate::scene::model::solid_history::is_specialized_property(property.field))
|
||||
});
|
||||
});
|
||||
sections.retain(|section| !section.props.is_empty());
|
||||
@@ -4237,6 +4252,29 @@ mod grip_limit_tests {
|
||||
);
|
||||
}
|
||||
|
||||
/// The ViewCube, the UCS icon and selection cycling all have commands and
|
||||
/// status-bar pills, but their values lived only on the app struct: turn
|
||||
/// the ViewCube off, restart, and it came straight back. Nothing failed —
|
||||
/// the setting simply evaporated — which is exactly the kind of thing a
|
||||
/// round-trip test catches and a person does not.
|
||||
#[test]
|
||||
fn the_view_toggles_survive_a_save_and_load() {
|
||||
let mut app = OpenCADStudio::new_for_test();
|
||||
app.show_viewcube = false;
|
||||
app.show_ucs_icon = false;
|
||||
app.ucs_icon_at_origin = false;
|
||||
app.selection_cycling = true;
|
||||
|
||||
let saved = app.current_settings();
|
||||
let mut restored = OpenCADStudio::new_for_test();
|
||||
restored.apply_settings(&saved);
|
||||
|
||||
assert!(!restored.show_viewcube, "the ViewCube must stay off");
|
||||
assert!(!restored.show_ucs_icon);
|
||||
assert!(!restored.ucs_icon_at_origin);
|
||||
assert!(restored.selection_cycling);
|
||||
}
|
||||
|
||||
/// The Options card writes these four straight onto the app and relies on
|
||||
/// the snapshot/restore pair to carry them across a restart. Three of them
|
||||
/// had no UI until now and so no reason for anyone to notice if the pair
|
||||
|
||||
Reference in new issue
Block a user