forked from 1b-agent/opencadstudio-upstream
feat(ui): bulk layer on/off, lock, freeze, transparency + Ctrl+A (#236)
The Layer Manager already applied colour/linetype/lineweight in bulk; extend that to the rest: - Visibility, lock and freeze toggles now act on every selected layer, not just the clicked row. The clicked row's new state becomes the target for all. Transparency edits apply to the whole selection too. - Clicking a linetype/lineweight combo on a row that is already part of a multi-selection no longer collapses the selection (the whole row is one mouse_area whose plain-click select would otherwise reset it), so those edits stay bulk. - Ctrl/Cmd+A selects every layer row while the Layer Manager is open, and all drawing objects otherwise. Two now-unused Scene layer-toggle helpers are removed (the handlers set the flags directly and bump once). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
5e4e7c1020
commit
818638d3aa
5 files changed
+135
-63
No files matched your search
@@ -709,6 +709,22 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
||||
Task::none()
|
||||
}
|
||||
|
||||
/// Layers a Layer-manager row toggle (visibility / lock / freeze /
|
||||
/// transparency) should affect: the whole multi-selection when the clicked
|
||||
/// row is part of it, otherwise just the clicked row — so those toggles work
|
||||
/// in bulk like the color / linetype / lineweight edits already do (#236).
|
||||
pub(super) fn layer_row_action_targets(&self, i: usize, idx: usize) -> Vec<String> {
|
||||
let Some(clicked) = self.tabs[i].layers.layers.get(idx).map(|l| l.name.clone()) else {
|
||||
return Vec::new();
|
||||
};
|
||||
let selected = self.selected_layer_names(i);
|
||||
if selected.iter().any(|n| n == &clicked) {
|
||||
selected
|
||||
} else {
|
||||
vec![clicked]
|
||||
}
|
||||
}
|
||||
|
||||
/// Layer names for the current Layer-manager selection — every row in the
|
||||
/// multi-selection, or the anchor row when the multi-set is empty. Bulk
|
||||
/// property edits and deletion act on these.
|
||||
|
||||
Reference in new issue
Block a user