diff --git a/src/app/mod.rs b/src/app/mod.rs index a477ebff6..c6596facf 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -390,6 +390,7 @@ pub(super) struct OpenCADStudio { ds_dimtm: String, ds_dimtdec: String, ds_dimtfac: String, + ds_annotative: bool, } /// What triggered the "unsaved changes" dialog. @@ -432,6 +433,7 @@ pub enum DsField { Dimtm, Dimtdec, Dimtfac, + Annotative, } #[derive(Debug, Clone)] @@ -1100,6 +1102,7 @@ impl OpenCADStudio { ds_dimtm: "0".to_string(), ds_dimtdec: "2".to_string(), ds_dimtfac: "1".to_string(), + ds_annotative: false, }; app.sync_ribbon_layers(); app diff --git a/src/app/update.rs b/src/app/update.rs index b18738092..2e9b77872 100644 --- a/src/app/update.rs +++ b/src/app/update.rs @@ -6500,6 +6500,7 @@ impl OpenCADStudio { self.ds_dimtm = format!("{}", ds.dimtm); self.ds_dimtdec = format!("{}", ds.dimtdec); self.ds_dimtfac = format!("{}", ds.dimtfac); + self.ds_annotative = ds.annotative; } /// Write edit buffers back into the selected dim style document entry. @@ -6551,6 +6552,7 @@ impl OpenCADStudio { ds.dimlim = self.ds_dimlim; ds.dimpost = self.ds_dimpost.clone(); ds.dimtxsty = self.ds_dimtxsty.clone(); + ds.annotative = self.ds_annotative; self.tabs[tab].dirty = true; self.command_line .push_output(&format!("DimStyle '{}' updated.", self.dimstyle_selected)); @@ -6597,6 +6599,7 @@ impl OpenCADStudio { Dimtoh => self.ds_dimtoh = !self.ds_dimtoh, Dimtol => self.ds_dimtol = !self.ds_dimtol, Dimlim => self.ds_dimlim = !self.ds_dimlim, + Annotative => self.ds_annotative = !self.ds_annotative, _ => {} } } diff --git a/src/app/view.rs b/src/app/view.rs index 4077bddab..1fde48cf4 100644 --- a/src/app/view.rs +++ b/src/app/view.rs @@ -215,6 +215,7 @@ impl OpenCADStudio { dimtm: &self.ds_dimtm, dimtdec: &self.ds_dimtdec, dimtfac: &self.ds_dimtfac, + annotative: self.ds_annotative, }, ); } diff --git a/src/ui/dimstyle.rs b/src/ui/dimstyle.rs index d0e703d92..e16baabc5 100644 --- a/src/ui/dimstyle.rs +++ b/src/ui/dimstyle.rs @@ -89,6 +89,7 @@ pub struct DimStyleValues<'a> { pub dimtm: &'a str, pub dimtdec: &'a str, pub dimtfac: &'a str, + pub annotative: bool, } fn btn_s(accent: bool) -> impl Fn(&Theme, button::Status) -> button::Style { @@ -422,6 +423,7 @@ pub fn view_window<'a>( .into(), 3 => column![ text("Scale").size(11).color(ACCENT), + chk("Annotative", vals.annotative, DsField::Annotative), row![ lbl("Overall scale (DIMSCALE)"), mk_field(DsField::Dimscale, vals.dimscale)