Layers: deleting layers that hold art asks first

The Layers panel's trash button, rows dropped on it, the panel menu's
Delete Selection, and Delete or Backspace on highlighted rows now run
ui.layerDelete. When a layer or sublayer among the rows holds art
(hidden, locked and nested objects count; guides do not), a confirm
dialog asks first. OK deletes the rows it asked about, by id, in the
document it was asked in, as one undo step; Cancel keeps them. Empty
layers, guide-only layers and object or group rows alone are deleted at
once. layer.delete itself is unchanged and never asks.
This commit is contained in:
dotCooCoo
2026-11-12 20:43:56 -08:00
parent f062dd7ed2
commit 367c092fee
36 changed files with 298 additions and 9 deletions
+3
View File
@@ -140,6 +140,9 @@ of another kind, it moves.
Confirmations: deleting swatches from the Swatches panel opens a `confirm` dialog (fields `message`, `detail`);
`ui.dialog.confirm` runs the command it asks about (here `swatch.delete`) and `ui.dialog.cancel` drops it.
Deleting Layers panel rows that include a layer or sublayer with art (`engine.execute` of `ui.layerDelete`, which the
panel's trash, its menu's Delete Selection and Delete or Backspace run) opens a `confirm` dialog too; its OK deletes
those rows with `layer.delete` in the document the question was asked in. `layer.delete` itself deletes at once.
New swatches and colour groups: `ui.newSwatch {spot?, global?, group?}` opens the `newSwatch` dialog prefilled from the active
fill or stroke (fields as in `swatchOptions` plus `group`; a gradient or pattern only takes `name`) and