forked from 1b-agent/opencadstudio-upstream
feat(properties): rework Text/MText/MLeader/Leader panels to standard layout
Match the entity Properties panels to the standard CAD layout and web-verified behaviour: - Text: combined Justify (horizontal x vertical) dropdown; Position and Text-alignment rows become editable/grayed by justification; drop the Annotative-scale row. - MText: combined Justify; editable Direction, Line space distance (back-solves the factor) and Line space style; Defined width/height gated on column mode. - MLeader: regrouped to match the palette - drop the Leader Structure group (fold landing rows into Leaders), gate Text vs Block on content type, full 9-value attachment label set, resolve handle-backed rows (style, text style, arrowhead, linetype) to names. - Leader: Lines & Arrows / Text / Fit are resolved from the dimension style (arrowhead, arrow size, dim-line lineweight/colour, text gap, vertical text pos, overall scale); Current Vertex navigator; combined Type; Geometry group after General; no 3D-Visualisation group. - General: rename "LT Scale" to "Linetype scale"; show ByLayer transparency by name. Add shared num_prop helper for conditionally editable numeric rows. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
b61bc0fdc0
commit
e3d5edf9b7
7 files changed
+714
-388
No files matched your search
Vendored
+13
-3
@@ -9,7 +9,16 @@ pub fn general_section(entity: &EntityType) -> PropSection {
|
||||
} else {
|
||||
common.linetype.clone()
|
||||
};
|
||||
let transp_pct = (common.transparency.alpha() as f64 / 255.0 * 100.0).round() as u32;
|
||||
// Alpha 0 is the ByLayer default (Transparency::BY_LAYER); show it by name
|
||||
// and fall back to a rounded percentage only for an explicit value.
|
||||
let transp_display = if common.transparency.alpha() == 0 {
|
||||
"ByLayer".to_string()
|
||||
} else {
|
||||
format!(
|
||||
"{}",
|
||||
(common.transparency.alpha() as f64 / 255.0 * 100.0).round() as u32
|
||||
)
|
||||
};
|
||||
|
||||
// Hyperlink is stored in XDATA under the "PE_URL" application.
|
||||
let hyperlink = common
|
||||
@@ -47,7 +56,7 @@ pub fn general_section(entity: &EntityType) -> PropSection {
|
||||
value: PropValue::LinetypeChoice(linetype_display),
|
||||
},
|
||||
Property {
|
||||
label: "LT Scale".into(),
|
||||
label: "Linetype scale".into(),
|
||||
field: "linetype_scale",
|
||||
value: PropValue::EditText(format!("{:.4}", common.linetype_scale)),
|
||||
},
|
||||
@@ -71,7 +80,7 @@ pub fn general_section(entity: &EntityType) -> PropSection {
|
||||
Property {
|
||||
label: "Transparency".into(),
|
||||
field: "transparency",
|
||||
value: PropValue::EditText(format!("{transp_pct}")),
|
||||
value: PropValue::EditText(transp_display),
|
||||
},
|
||||
Property {
|
||||
label: "Hyperlink".into(),
|
||||
@@ -102,6 +111,7 @@ pub fn visualization_section(entity: &EntityType) -> Option<PropSection> {
|
||||
EntityType::Block(_)
|
||||
| EntityType::BlockEnd(_)
|
||||
| EntityType::Seqend(_)
|
||||
| EntityType::Leader(_)
|
||||
| EntityType::Unknown(_)
|
||||
) {
|
||||
return None;
|
||||
|
||||
Reference in new issue
Block a user