Better (or context-aware) delete/move objects in Layers and Objects dialog
Summary:
Currently, the buttons ('delete', 'move up' and 'move down') in the layer dialog act on the selected object. This produces unexpected results in some edge-cases (see Steps to reproduce) - and requires layers to be 'selected' in order to delete/move them (inkscape#2734 (closed)). The latter issue is handled by 'selecting' layers in the first click (inkscape@9ffd0fb0), which seems to cause inkscape#3527 (closed) and inkscape#3839 (closed).
Proposal
- revert layer 'selection' to second click
- make buttons act differently depending on mode and selection
| Mode | Selection | Action | Result |
|---|---|---|---|
| Show-Objects | Yes | app.delete-selection |
Delete Selected Object |
| Show-Objects | No | win.layer-delete |
Delete Current Layer |
| Layers-only | Yes | win.layer-delete |
Delete Current Layer |
| Layers-only | No | win.layer-delete |
Delete Current Layer |
(moving also would work similarly). While this won't fix it, with layer 'selection' taking two clicks, inkscape#3527 (closed) will not happen as frequently as it does (and would imo be the expected behavior when it does). This would also handle the edge-cases (but, judging from the number of reports, these are rare and low-priority bugs)
Steps to reproduce:
Layers-Only Mode:
- Create two layers L1 and L2
- Create a few objects in L2
- Reorder L2 using Layers dialog
- Nothing happened / selection was moved forward/backward
- Deselect all objects
- Delete layer with using dialog
- Nothing happened / layer has to re-selected for deletion
Objects Mode:
- Make two layers
- Create objects in L2
- Deselect everything
- Delete/Move in Layers dialog
- Nothing happened (But current layer is highlighted and therefore expected to be moved/deleted)
Version info
Inkscape 1.3-dev (def5eff1, 2022-10-25)
GLib version: 2.74.0
GTK version: 3.24.34
glibmm version: 2.66.5
gtkmm version: 3.24.7
libxml2 version: 2.10.3
libxslt version: 1.1.37
Cairo version: 1.17.6
Pango version: 1.50.11
HarfBuzz version: 5.3.1
OS version: Windows 10 21H1