From f738a204571edf0f1503f1148473fe2dcd44b595 Mon Sep 17 00:00:00 2001 From: Hakan Date: Fri, 15 May 2026 09:19:57 +0300 Subject: [PATCH] feat(properties): label xref Insert as "External Reference" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Match AutoCAD properties panel — Insert whose block_record carries is_xref/is_xref_overlay now shows "External Reference" instead of "Block Reference". Silence dead_code warning on XrefStatus::Unloaded (intentional, awaiting on-disk Unload-bit detection). Co-Authored-By: Claude Opus 4.7 --- src/app/properties.rs | 19 ++++++++++++++++++- src/io/xref.rs | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/app/properties.rs b/src/app/properties.rs index 150d47632..ca6b52de5 100644 --- a/src/app/properties.rs +++ b/src/app/properties.rs @@ -174,7 +174,24 @@ impl H7CAD { }); } } - let title = entity_type_label(entity); + let title = match entity { + acadrust::EntityType::Insert(ins) => { + let is_xref = self.tabs[i] + .scene + .document + .block_records + .iter() + .find(|br| br.name == ins.block_name) + .map(|br| br.flags.is_xref || br.flags.is_xref_overlay) + .unwrap_or(false); + if is_xref { + "External Reference".to_string() + } else { + entity_type_label(entity) + } + } + _ => entity_type_label(entity), + }; ui::PropertiesPanel { choice_combos: sections .iter() diff --git a/src/io/xref.rs b/src/io/xref.rs index 1be1a0668..6572c5c4a 100644 --- a/src/io/xref.rs +++ b/src/io/xref.rs @@ -17,6 +17,7 @@ pub enum XrefStatus { NotFound, /// XRef is marked Unloaded in the host DWG — we honor that and /// skip resolving the external file. The user can re-load via UI. + #[allow(dead_code)] Unloaded, }