diff --git a/src/app/mod.rs b/src/app/mod.rs index c6596facf..a7d126f2c 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -898,6 +898,8 @@ pub enum Message { TableStyleDialogSelect(String), TableStyleDialogNew, TableStyleDialogDelete, + /// Toggle the Annotative flag on the selected table style. + TableStyleToggleAnnotative, // ── MLineStyle Dialog ───────────────────────────────────────────────── MlStyleDialogOpen, #[allow(dead_code)] diff --git a/src/app/update.rs b/src/app/update.rs index 2e9b77872..0c2742bc8 100644 --- a/src/app/update.rs +++ b/src/app/update.rs @@ -5744,6 +5744,22 @@ impl OpenCADStudio { Task::none() } + Message::TableStyleToggleAnnotative => { + use acadrust::objects::ObjectType; + let i = self.active_tab; + let name = self.tablestyle_selected.clone(); + self.push_undo_snapshot(i, "TABLESTYLE EDIT"); + for obj in self.tabs[i].scene.document.objects.values_mut() { + if let ObjectType::TableStyle(s) = obj { + if s.name == name { + s.annotative = !s.annotative; + } + } + } + self.tabs[i].dirty = true; + Task::none() + } + Message::TableStyleDialogNew => { use acadrust::objects::ObjectType; let i = self.active_tab; diff --git a/src/ui/tablestyle.rs b/src/ui/tablestyle.rs index 6467db34f..fb27756ab 100644 --- a/src/ui/tablestyle.rs +++ b/src/ui/tablestyle.rs @@ -1,7 +1,7 @@ //! Table Style Manager window — fills the entire OS window. use crate::app::Message; -use iced::widget::{button, column, container, row, scrollable, text, Space}; +use iced::widget::{button, checkbox, column, container, row, scrollable, text, Space}; use iced::{Background, Border, Color, Element, Fill, Theme}; const TB: Color = Color { @@ -222,6 +222,11 @@ pub fn view_window<'a>( scrollable( column![ info_row("Name:", s.name.clone()), + checkbox(s.annotative) + .label("Annotative") + .on_toggle(|_| Message::TableStyleToggleAnnotative) + .size(14) + .text_size(11), info_row("H Margin:", format!("{:.4}", s.horizontal_margin)), info_row("V Margin:", format!("{:.4}", s.vertical_margin)), info_row("Title Suppressed:", s.title_suppressed.to_string()),