diff --git a/src/app/commands/styleprops.rs b/src/app/commands/styleprops.rs index 430256eaf..46cb4118d 100644 --- a/src/app/commands/styleprops.rs +++ b/src/app/commands/styleprops.rs @@ -1350,9 +1350,15 @@ impl OpenCADStudio { if let Some(value) = &value { match value.parse::().ok().filter(|v| (-90..=90).contains(v)) { Some(fade) => self.set_xref_fade(fade), - None => self - .command_line - .push_error("Requires an integer between -90 and 90."), + // Refused: say why and ask again. + None => { + self.command_line + .push_error("Requires an integer between -90 and 90."); + self.command_line.push_output(&format!( + "Enter new value for XDWGFADECTL <{current}>:" + )); + self.pending_setvar = Some(name.clone()); + } } } else { self.command_line.push_output(&format!( @@ -4521,11 +4527,12 @@ mod scale_validation_tests { } impl OpenCADStudio { - /// XDWGFADECTL: store it, show it on the ribbon and redraw every tab's - /// referenced drawings. + /// XDWGFADECTL: store it in the profile, show it on the ribbon and redraw + /// every tab's referenced drawings. pub(in crate::app) fn set_xref_fade(&mut self, fade: i32) { crate::scene::cache::block_cache::set_xref_fade_ctl(fade); self.ribbon.xref_fade = crate::scene::cache::block_cache::xref_fade_ctl(); + self.save_config(); for tab in &mut self.tabs { if !tab.is_start { tab.scene.recolor_meshes(); diff --git a/src/app/settings.rs b/src/app/settings.rs index 5f5aefc0c..dd431e8a4 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -423,6 +423,8 @@ pub struct UserSettings { pub attdef_on_screen: bool, /// FIELDDISPLAY: fields show on a gray background. pub field_display: bool, + /// XDWGFADECTL: how much referenced drawings fade (-90..=90; negative is off). + pub xref_fade: i32, /// SURFACEASSOCIATIVITY: new surfaces stay associative to their sources. pub surface_associativity: bool, /// UCSORTHO: an orthographic view preset also sets its orthographic UCS. @@ -853,6 +855,7 @@ impl Default for UserSettings { image_frame: 1, attdef_on_screen: true, field_display: true, + xref_fade: 50, surface_associativity: true, ucs_ortho: true, ucs_view: true, diff --git a/src/app/update/file.rs b/src/app/update/file.rs index 3b9a478eb..fa84e084d 100644 --- a/src/app/update/file.rs +++ b/src/app/update/file.rs @@ -796,6 +796,7 @@ impl OpenCADStudio { image_frame: crate::scene::frame::profile_image_mode(), attdef_on_screen: crate::modules::draw::draw::attdef::session().on_screen, field_display: crate::entities::field::display(), + xref_fade: crate::scene::cache::block_cache::xref_fade_ctl(), surface_associativity: crate::scene::model::sweep_model::surface_associativity(), ucs_ortho: crate::modules::view::view_cmd::ucs_ortho(), ucs_view: crate::modules::view::view_cmd::ucs_view(), @@ -916,6 +917,8 @@ impl OpenCADStudio { crate::scene::frame::set_profile_image_mode(s.image_frame); crate::modules::draw::draw::attdef::session().on_screen = s.attdef_on_screen; crate::entities::field::set_display(s.field_display); + crate::scene::cache::block_cache::set_xref_fade_ctl(s.xref_fade); + self.ribbon.xref_fade = crate::scene::cache::block_cache::xref_fade_ctl(); crate::scene::model::sweep_model::set_surface_associativity(s.surface_associativity); crate::modules::view::view_cmd::set_ucs_ortho(s.ucs_ortho); crate::modules::view::view_cmd::set_ucs_view(s.ucs_view);