forked from 1b-agent/opencadstudio-upstream
Merge PR #1280 and expose constraint value visibility
This commit is contained in:
commit
dfe8b77cca
7 files changed
+70
-9
No files matched your search
@@ -8038,6 +8038,15 @@ mod parametric_constraint_undo_tests {
|
||||
crate::scene::model::object::PropValue::ParamRow { name, .. }
|
||||
if name == "width"
|
||||
)));
|
||||
assert!(app.tabs[app.active_tab]
|
||||
.properties
|
||||
.sections
|
||||
.iter()
|
||||
.flat_map(|section| §ion.props)
|
||||
.any(|property| matches!(
|
||||
property.value,
|
||||
crate::scene::model::object::PropValue::ParamsVisibilityToggle(_)
|
||||
)));
|
||||
}
|
||||
|
||||
/// End-to-end through the actual `Message` handlers a Properties-panel
|
||||
|
||||
@@ -25,7 +25,7 @@ impl OpenCADStudio {
|
||||
.collect();
|
||||
if handles.len() < 2 {
|
||||
self.command_line
|
||||
.push_info(crate::t!("Select at least two unlocked objects to align.").as_ref());
|
||||
.push_info(crate::t!("Select objects").as_ref());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -54,8 +54,6 @@ impl OpenCADStudio {
|
||||
})
|
||||
.collect();
|
||||
if bounds.len() < 2 {
|
||||
self.command_line
|
||||
.push_info(crate::t!("The selected objects do not provide usable bounds.").as_ref());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+12
-3
@@ -487,7 +487,14 @@ impl OpenCADStudio {
|
||||
PropSection {
|
||||
title: t!("Parameters").into_owned(),
|
||||
props: {
|
||||
let mut props: Vec<Property> = scene
|
||||
let mut props = vec![Property {
|
||||
label: String::new(),
|
||||
field: "show_constraint_values",
|
||||
value: PropValue::ParamsVisibilityToggle(
|
||||
self.show_constraint_values,
|
||||
),
|
||||
}];
|
||||
props.extend(scene
|
||||
.named_parameters()
|
||||
.iter()
|
||||
.enumerate()
|
||||
@@ -503,8 +510,7 @@ impl OpenCADStudio {
|
||||
.resolve(¶meter.name)
|
||||
.map_err(|error| error.to_string()),
|
||||
},
|
||||
})
|
||||
.collect();
|
||||
}));
|
||||
props.push(Property {
|
||||
label: String::new(),
|
||||
field: "named_parameter_add",
|
||||
@@ -3267,6 +3273,9 @@ fn make_sections_read_only(sections: &mut [crate::scene::model::object::PropSect
|
||||
PropValue::EntityLink { handles, .. } => format!("{} entity link(s)", handles.len()),
|
||||
PropValue::ParamRow { name, formula, .. } => format!("{name} = {formula}"),
|
||||
PropValue::ParamAddRow => String::new(),
|
||||
PropValue::ParamsVisibilityToggle(value) => {
|
||||
if *value { t!("On") } else { t!("Off") }.into_owned()
|
||||
}
|
||||
};
|
||||
property.field = "locked_read_only";
|
||||
property.value = PropValue::ReadOnly(text);
|
||||
|
||||
@@ -1256,7 +1256,7 @@ pub(super) fn viewport_context_menu_overlay(
|
||||
// none of the entity-selection actions above (Move/Copy/Isolate/
|
||||
// Select Similar) apply to it.
|
||||
items.push(item(
|
||||
t!("Delete Constraint").into_owned(),
|
||||
t!("Delete").into_owned(),
|
||||
Message::PropConstraintDelete(id),
|
||||
));
|
||||
items.push(sep());
|
||||
|
||||
Reference in new issue
Block a user