forked from 1b-agent/opencadstudio-upstream
EXTERNALREFERENCES opens, EXTERNALREFERENCESCLOSE, ERSTATE, reference aliases
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
b1d4c9bd9b
commit
63bfb5d5b6
5 files changed
+31
-14
No files matched your search
@@ -71,6 +71,9 @@ BE, *BEDIT
|
||||
IAT, *IMAGEATTACH
|
||||
XA, *XATTACH
|
||||
XR, *XREF
|
||||
-XR, *-XREF
|
||||
XC, *XCLIP
|
||||
ICL, *IMAGECLIP
|
||||
ADC, *ADCENTER
|
||||
W, *WBLOCK
|
||||
|
||||
|
||||
+2
-1
@@ -80,7 +80,7 @@ const WEB_ALIAS_KEY: &str = "opencadstudio.aliases";
|
||||
/// migrated forward (see `introduced_at` / `migrate_aliases`). Version 1 shipped
|
||||
/// the pre-REDRAW table; version 2 introduced the REDRAW-family aliases; version 3
|
||||
/// introduced HB (HATCHTOBACK); version 4 introduced ER (EXTERNALREFERENCES).
|
||||
const DEFAULT_ALIASES_VERSION: u32 = 7;
|
||||
const DEFAULT_ALIASES_VERSION: u32 = 8;
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
const WEB_ALIAS_VERSION_KEY: &str = "opencadstudio.aliases.version";
|
||||
@@ -102,6 +102,7 @@ fn introduced_at(version: u32) -> &'static [(&'static str, &'static str)] {
|
||||
5 => &[("-ATT", "-ATTDEF")],
|
||||
6 => &[("VV", "QLAYER")],
|
||||
7 => &[("DV", "DVIEW")],
|
||||
8 => &[("-XR", "-XREF"), ("XC", "XCLIP"), ("ICL", "IMAGECLIP")],
|
||||
_ => &[],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -951,17 +951,30 @@ impl OpenCADStudio {
|
||||
}
|
||||
}
|
||||
|
||||
// EXTERNALREFERENCES — toggle the docked External References panel.
|
||||
// EXTERNALREFERENCES opens the docked External References panel
|
||||
// (an open one stays open); EXTERNALREFERENCESCLOSE closes it.
|
||||
// (XREFMAN was a provisional name and is not kept, not even as an
|
||||
// alias.) The XREF command below is untouched.
|
||||
"EXTERNALREFERENCES" => {
|
||||
self.show_external_references ^= true;
|
||||
if self.show_external_references {
|
||||
// Always open expanded so the panel is immediately usable;
|
||||
// dock it on the right if the user closed it from the layout.
|
||||
self.dock_open_at_default(crate::ui::dock::PanelId::ExternalReferences);
|
||||
self.refresh_xref_manager();
|
||||
}
|
||||
self.show_external_references = true;
|
||||
// Always open expanded so the panel is immediately usable;
|
||||
// dock it on the right if the user closed it from the layout.
|
||||
self.dock_open_at_default(crate::ui::dock::PanelId::ExternalReferences);
|
||||
self.refresh_xref_manager();
|
||||
}
|
||||
"EXTERNALREFERENCESCLOSE" => self.show_external_references = false,
|
||||
// ERSTATE (read only): whether the panel is open.
|
||||
cmd if cmd
|
||||
.strip_prefix("SETVAR ")
|
||||
.unwrap_or(cmd)
|
||||
.split_whitespace()
|
||||
.next()
|
||||
.is_some_and(|name| name.eq_ignore_ascii_case("ERSTATE")) =>
|
||||
{
|
||||
self.command_line.push_output(&format!(
|
||||
"ERSTATE = {} (read only)",
|
||||
u8::from(self.show_external_references)
|
||||
));
|
||||
}
|
||||
|
||||
cmd if cmd.eq_ignore_ascii_case("XREF")
|
||||
|
||||
@@ -819,6 +819,8 @@ inventory::submit!(crate::command::CommandRegistration {
|
||||
"EXPORTSTEP",
|
||||
"EXPORTSTL",
|
||||
"EXTERNALREFERENCES",
|
||||
"EXTERNALREFERENCESCLOSE",
|
||||
"ERSTATE",
|
||||
"POINTCLOUDMANAGER",
|
||||
"POINTCLOUDMANAGERCLOSE",
|
||||
"EXTRIM",
|
||||
|
||||
@@ -311,7 +311,8 @@ pub(super) fn group_title<'a>(
|
||||
if panel.id != REFERENCE_PANEL_ID {
|
||||
return title_button;
|
||||
}
|
||||
// The corner arrow opens the External References palette.
|
||||
// The corner arrow opens the External References palette, or closes it
|
||||
// when it is open.
|
||||
let launcher = tooltip(
|
||||
// A right arrow turned to point into the corner.
|
||||
button(
|
||||
@@ -323,10 +324,7 @@ pub(super) fn group_title<'a>(
|
||||
color: Some(theme.palette().background.base.text),
|
||||
}),
|
||||
)
|
||||
.on_press(Message::RibbonToolClick {
|
||||
tool_id: "EXTERNALREFERENCES".to_string(),
|
||||
event: crate::modules::ModuleEvent::Command("EXTERNALREFERENCES".to_string()),
|
||||
})
|
||||
.on_press(Message::ToggleXrefManager)
|
||||
.style(move |theme: &Theme, status| tool_btn_style(theme, false, status))
|
||||
.padding([0, 3]),
|
||||
make_tip(format!(
|
||||
|
||||
Reference in new issue
Block a user