feat: add style selector comboboxes to Annotate ribbon tab
New StyleComboGroup RibbonItem renders a dropdown combobox for selecting text style, dimension style, multileader style, or table style. Ribbon groups in the Annotate tab now match the reference layout: each group has a large tool on the left and a style combobox with tool rows on the right. Each combobox shows the active style name, opens a scrollable item list on click, and has an optional "Manage…" row that fires the style manager command (STYLE / DIMSTYLE / MLEADERSTYLE / TABLESTYLE). Style state is synced from the document on every layer refresh via sync_ribbon_styles(). RibbonStyleChanged message propagates selections back to the acadrust document header and the active_mleader_style field. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
08b9a21d31
commit
bd68114bde
7 changed files with 431 additions and 36 deletions
|
|
@ -1929,6 +1929,43 @@ impl H7CAD {
|
|||
Task::none()
|
||||
}
|
||||
|
||||
Message::RibbonStyleChanged { key, name } => {
|
||||
use crate::modules::StyleKey;
|
||||
self.ribbon.close_dropdown();
|
||||
match key {
|
||||
StyleKey::TextStyle => {
|
||||
self.ribbon.active_text_style = name.clone();
|
||||
let i = self.active_tab;
|
||||
let found = self.tabs[i].scene.document.text_styles.iter()
|
||||
.find(|s| s.name == name)
|
||||
.map(|ts| ts.handle);
|
||||
if let Some(h) = found {
|
||||
self.tabs[i].scene.document.header.current_text_style_handle = h;
|
||||
self.tabs[i].scene.document.header.current_text_style_name = name;
|
||||
}
|
||||
}
|
||||
StyleKey::DimStyle => {
|
||||
self.ribbon.active_dim_style = name.clone();
|
||||
let i = self.active_tab;
|
||||
let found = self.tabs[i].scene.document.dim_styles.get(&name)
|
||||
.map(|ds| ds.handle);
|
||||
if let Some(h) = found {
|
||||
self.tabs[i].scene.document.header.current_dimstyle_handle = h;
|
||||
self.tabs[i].scene.document.header.current_dimstyle_name = name;
|
||||
}
|
||||
}
|
||||
StyleKey::MLeaderStyle => {
|
||||
self.ribbon.active_mleader_style = name.clone();
|
||||
let i = self.active_tab;
|
||||
self.tabs[i].active_mleader_style = name;
|
||||
}
|
||||
StyleKey::TableStyle => {
|
||||
self.ribbon.active_table_style = name;
|
||||
}
|
||||
}
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::PropLayerChanged(layer) => {
|
||||
let i = self.active_tab;
|
||||
let handles = self.property_target_handles(i);
|
||||
|
|
|
|||
Loading…
Reference in a new issue