forked from 1b-agent/opencadstudio-upstream
Merge pull request #1549 from MarcelP102/codex/graphic-attributes-cleanup
[UX] Introducing graphic attributes panel # Conflicts: # locales/ar-SA/opencadstudio.ftl # locales/bg-BG/opencadstudio.ftl # locales/cs-CZ/opencadstudio.ftl # locales/de-DE/opencadstudio.ftl # locales/el-GR/opencadstudio.ftl # locales/en-US/opencadstudio.ftl # locales/es-ES/opencadstudio.ftl # locales/fi-FI/opencadstudio.ftl # locales/fr-FR/opencadstudio.ftl # locales/hi-IN/opencadstudio.ftl # locales/hu-HU/opencadstudio.ftl # locales/it-IT/opencadstudio.ftl # locales/ja-JP/opencadstudio.ftl # locales/ko-KR/opencadstudio.ftl # locales/lo-LA/opencadstudio.ftl # locales/nl-NL/opencadstudio.ftl # locales/pl-PL/opencadstudio.ftl # locales/pt-BR/opencadstudio.ftl # locales/ru-RU/opencadstudio.ftl # locales/tr-TR/opencadstudio.ftl # locales/zh-CN/opencadstudio.ftl # locales/zh-TW/opencadstudio.ftl # src/app/mod.rs # src/app/update/dialog.rs # src/app/view/mod.rs # src/locale_catalog.rs # src/ui/dock.rs
This commit is contained in:
commit
1333efcad2
68 files changed
+6178
-173
No files matched your search
@@ -394,6 +394,10 @@ impl OpenCADStudio {
|
||||
// dropdown so the dispatched command's new prompt is
|
||||
// immediately visible on the overlay.
|
||||
self.command_line.close_history();
|
||||
if self.awaiting_fill_close_answer() {
|
||||
let input = std::mem::take(&mut self.command_line.input);
|
||||
return self.on_graphic_fill_close_input(&input);
|
||||
}
|
||||
// A leading `>` was only a "literal spaces" typing hint (see
|
||||
// CommandSpace) — drop it before the input is interpreted.
|
||||
// Free-form text prompts keep it: there it is content, not a
|
||||
@@ -1100,6 +1104,9 @@ impl OpenCADStudio {
|
||||
if !self.command_line.input.trim().is_empty() {
|
||||
return self.update(Message::CommandSubmit);
|
||||
}
|
||||
if self.awaiting_fill_close_answer() {
|
||||
return self.on_graphic_fill_close_input("");
|
||||
}
|
||||
// A grip edit is not an active CAD command, but its Dynamic Input
|
||||
// fields use the same keyboard path. Route Enter through CommandSubmit,
|
||||
// whose grip branch resolves Distance / Angle and finalizes the edit.
|
||||
@@ -1154,6 +1161,11 @@ impl OpenCADStudio {
|
||||
if self.ribbon.escape_extension() {
|
||||
return Task::none();
|
||||
}
|
||||
if self.awaiting_fill_close_answer() {
|
||||
self.graphic_attributes.pending_fill_close = None;
|
||||
self.command_line.push_info(crate::t!("*Cancel*").as_ref());
|
||||
return Task::none();
|
||||
}
|
||||
// Esc drops an unconsumed one-shot snap override and closes
|
||||
// its menu (#337). Falls through — Esc keeps its usual effect.
|
||||
self.snap_override_popup = None;
|
||||
@@ -2225,6 +2237,35 @@ impl OpenCADStudio {
|
||||
Task::none()
|
||||
}
|
||||
|
||||
pub(super) fn on_ribbon_lineweight_changed(
|
||||
&mut self,
|
||||
lw: codec::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();
|
||||
@@ -2331,11 +2372,20 @@ impl OpenCADStudio {
|
||||
pub(super) fn on_prop_hatch_pattern_changed(&mut self, name: String) -> Task<Message> {
|
||||
let i = self.active_tab;
|
||||
let handles = self.property_target_handles(i);
|
||||
self.apply_hatch_pattern(i, &handles, name)
|
||||
}
|
||||
|
||||
pub(super) fn apply_hatch_pattern(
|
||||
&mut self,
|
||||
i: usize,
|
||||
handles: &[codec::Handle],
|
||||
name: String,
|
||||
) -> Task<Message> {
|
||||
if !handles.is_empty() {
|
||||
use crate::scene::model::hatch_patterns;
|
||||
if let Some(entry) = hatch_patterns::find(&name) {
|
||||
self.push_undo_snapshot(i, "HATCHEDIT");
|
||||
for &handle in &handles {
|
||||
for &handle in handles {
|
||||
if let Some(codec::EntityType::Hatch(dxf)) =
|
||||
self.tabs[i].scene.document.get_entity_mut(handle)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user