forked from 1b-agent/opencadstudio-upstream
feat(block): fade context, free editing and a Save/Discard toolbar in REFEDIT
In-place block edit now reads more like a dedicated editor: - Fade everything except the edited entities toward the background (wires, block instances and 3D solid meshes) so the block stands out while the surrounding drawing stays visible for context. - Don't leave a command active on enter — the user edits the block's geometry freely (move, grips, draw, erase) and finishes explicitly. - Show the right-edge vertical toolbar with clickable Save (REFCLOSE_SAVE) and Discard (REFCLOSE_DISCARD) buttons while a session is active, so the edit can be ended without typing. The fade clears on save/discard, restoring full brightness. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
5052d2338c
commit
038052f5f9
4 files changed
+97
-9
No files matched your search
@@ -17,6 +17,26 @@ use acadrust::{EntityType, Handle};
|
||||
use glam::Vec3;
|
||||
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
|
||||
/// Right-edge side-toolbar buttons shown while a REFEDIT session is active:
|
||||
/// save the in-place block edit, or discard it. (#136)
|
||||
pub fn refedit_tools() -> Vec<ToolDef> {
|
||||
vec![
|
||||
ToolDef {
|
||||
id: "REFCLOSE_SAVE",
|
||||
label: "Save Block Edit",
|
||||
icon: IconKind::Svg(include_bytes!("../../../../assets/icons/mt_ok.svg")),
|
||||
event: ModuleEvent::Command("REFCLOSE_SAVE".to_string()),
|
||||
},
|
||||
ToolDef {
|
||||
id: "REFCLOSE_DISCARD",
|
||||
label: "Discard Block Edit",
|
||||
icon: IconKind::Svg(include_bytes!("../../../../assets/icons/mt_cancel.svg")),
|
||||
event: ModuleEvent::Command("REFCLOSE_DISCARD".to_string()),
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
// ── Session state (held in DocumentTab) ───────────────────────────────────
|
||||
|
||||
|
||||
Reference in new issue
Block a user