forked from 1b-agent/opencadstudio-upstream
Add Properties-panel Constraints/Parameters sections, a constraint-pill
value toggle, and redesigned constraint-ribbon icons Properties panel: - New "Parameters" section (shown with no selection) listing every named parameter with inline name/formula editing, add, and delete, backed by new PropValue::ParamRow/ParamAddRow and command_driver handlers (resolve_named_parameter_edit, on_prop_param_commit/_delete/_add_new). A fresh parameter's formula now defaults to "1", not "0" — a 0-length seed value is a genuine solver singularity for a Distance constraint driven by that parameter, with no defined direction to grow back out of. - New "Constraints" section (shown for a single selected entity) listing every constraint touching it as a clickable PropValue::EntityLink that selects the linked entities in the viewport, danger-tinted when the constraint conflicts. Constraint pills: - New Options > General toggle, "Show values and parameter names on constraint markers" (on by default, persisted). Off, every pill shows just its bare glyph instead of glyph+driven-value/parameter-name — the glyph alone is enough to see a constraint is present, without the value text covering nearby geometry on a dense sketch. Constraint-ribbon icons: - Replaced all 18 unicode/letter glyph icons (including the plain "F", "L", "M", "S" letters) with proper SVGs under assets/icons/constrain/, matching the Modify section's two-color style (#B4B6B9 white / #6DB7ED blue, consistent stroke width). Tangent reuses the Draw section's white-arc-plus-blue-dots motif. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
faf3473b2b
commit
bd9a2d08f7
36 files changed
+707
-26
No files matched your search
@@ -1,6 +1,6 @@
|
||||
// Shared value types used by the dispatch and grip systems.
|
||||
|
||||
use acadrust::types::{Color as AcadColor, LineWeight};
|
||||
use acadrust::types::{Color as AcadColor, Handle, LineWeight};
|
||||
use glam::DVec3;
|
||||
|
||||
/// The kind of value held by a property row.
|
||||
@@ -58,6 +58,28 @@ pub enum PropValue {
|
||||
/// an editable text_input. Unlike the other rows the routing key is the
|
||||
/// tag carried here, not the row's `&'static str` field.
|
||||
AttrText { tag: String, value: String },
|
||||
/// A clickable link to one or more entities — the Constraints section's
|
||||
/// row for one persistent sketch constraint. Clicking it selects every
|
||||
/// entity in `handles` in the viewport. `conflicting` mirrors
|
||||
/// `SketchConstraintSet::conflicts`, tinting the row the same danger
|
||||
/// color the constraint's glyph pill already uses.
|
||||
EntityLink { handles: Vec<Handle>, conflicting: bool },
|
||||
/// One row of the document-wide named-parameter table (Parameters
|
||||
/// section, shown when nothing is selected). `index` is the row's
|
||||
/// position in `ParameterTable::iter()` order — stable across edits to
|
||||
/// other rows, used to route `PropParamInput`/`PropParamCommit`/
|
||||
/// `PropParamDelete` back to the right parameter without re-keying on a
|
||||
/// name that might itself be mid-edit. `resolved` is the live value or
|
||||
/// error, recomputed fresh every render (same "cheap enough to rebuild"
|
||||
/// approach the old modal's preview column already used).
|
||||
ParamRow {
|
||||
index: usize,
|
||||
name: String,
|
||||
formula: String,
|
||||
resolved: Result<f64, String>,
|
||||
},
|
||||
/// The trailing "+ Add parameter" row in the Parameters section.
|
||||
ParamAddRow,
|
||||
}
|
||||
|
||||
/// A single property row in the Properties panel.
|
||||
|
||||
Reference in new issue
Block a user