REFEDIT session toolbar: definition name, working set count, REFSET

The right-edge toolbar of a REFEDIT session now shows the definition
being edited (REFEDITNAME) as an accent pill with the number of objects
in the working set, Add to / Remove from Working Set buttons with their
own icons (REFSET Add / Remove, straight to object selection), and
Save / Discard in a separate group below a rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-10-14 10:51:22 +03:00
1 parent 592289f4fd
commit 74d65c26be
29 files changed
+218 -7

No files matched your search

+28
View File
@@ -20,6 +20,25 @@ use std::collections::HashSet;
use crate::command::{CadCommand, CmdOption, CmdResult};
use crate::modules::{IconKind, ModuleEvent, ToolDef};
/// Right-edge side-toolbar buttons that move objects into or out of the
/// working set while a REFEDIT session is active (REFSET Add / Remove).
pub fn refedit_set_tools() -> Vec<ToolDef> {
vec![
ToolDef {
id: "REFSET_ADD",
label: "Add to Working Set",
icon: IconKind::Svg(include_bytes!("../../../../assets/icons/refset_add.svg")),
event: ModuleEvent::Command("REFSET_ADD".to_string()),
},
ToolDef {
id: "REFSET_REMOVE",
label: "Remove from Working Set",
icon: IconKind::Svg(include_bytes!("../../../../assets/icons/refset_remove.svg")),
event: ModuleEvent::Command("REFSET_REMOVE".to_string()),
},
]
}
/// 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> {
@@ -479,6 +498,15 @@ impl RefSetCommand {
selected: Vec::new(),
}
}
/// Straight to `Select objects:` for Add (`add`) or Remove.
pub fn selecting(add: bool) -> Self {
Self {
add,
gathering: true,
selected: Vec::new(),
}
}
}
impl CadCommand for RefSetCommand {