forked from 1b-agent/opencadstudio-upstream
Graphic Attributes: tidy helpers, split tests, translate the palette
- The hatch pattern picker takes its messages as one PatternPickerMessages struct instead of eight arguments. - The palette's fill index is keyed on the scene's geometry epoch alone; epochs are unique across scenes, so the scene address is not needed. - The ribbon lineweight handler is an on_ribbon_lineweight_changed method, used by the palette instead of a recursive update() call. - The 430-line palette test is split into eight focused tests with shared helpers; no checks were dropped. - Palette, gradient editor, prompts, messages and undo labels go through t!/tf!. The 33 new strings are in a graphic-attributes Fluent group in all 21 locales; "[Yes / No] <Yes>", ByLayer and ByBlock stay English. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VgkJN8DEojuPTumAXLHotu
This commit is contained in:
28 files changed
+1060
-482
No files matched your search
@@ -2155,6 +2155,32 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
||||
Task::none()
|
||||
}
|
||||
|
||||
pub(super) fn on_ribbon_lineweight_changed(&mut self, lw: acadrust::types::LineWeight) -> Task<Message> {
|
||||
let i = self.active_tab;
|
||||
self.ribbon.close_dropdown();
|
||||
let handles = self.property_target_handles(i);
|
||||
if handles.is_empty() {
|
||||
if self.has_property_selection(i) {
|
||||
return Task::none();
|
||||
}
|
||||
// Persist into the tab's header (CELWEIGHT). #21.
|
||||
self.tabs[i].scene.document.header.current_line_weight = lw.value();
|
||||
self.tabs[i].dirty = true;
|
||||
self.ribbon.active_lineweight = lw;
|
||||
} else {
|
||||
// Lineweight is baked into the cached wire geometry —
|
||||
// re-tessellate so the change shows immediately (issue #231
|
||||
// class).
|
||||
self.apply_property_op(i, "CHPROP", &handles, |app, handle| {
|
||||
if let Some(entity) = app.tabs[i].scene.document.get_entity_mut(handle) {
|
||||
crate::scene::view::dispatch::apply_line_weight(entity, lw);
|
||||
}
|
||||
});
|
||||
self.ribbon.active_lineweight = lw;
|
||||
}
|
||||
Task::none()
|
||||
}
|
||||
|
||||
pub(super) fn on_ribbon_linetype_changed(&mut self, lt: String) -> Task<Message> {
|
||||
let i = self.active_tab;
|
||||
self.ribbon.close_dropdown();
|
||||
|
||||
Reference in new issue
Block a user