GNOME Bugzilla – Bug 637313
Should be possible to copy/paste whole layers in a single step
Last modified: 2016-09-19 22:35:30 UTC
I just discovered that one can drag a layer from the layers dialog into another image window. This will create a copy of the layer in that other image. This is very nice, but if the original layer was called "Foo", then the copied layer is now called "Foo copy". It is inconvenient that you have to rename the layer back to "Foo", especially as you can't just hit F2 in the layers dialog to edit a layer's name (you have to right-click and find the "Edit layer attributes" option in the busy menu you get). I discovered that drag operation by accident. Initially I looked for a "Copy layer to clipboard" command or something similar. There isn't one, so I simply switched to the layer, hit Select All, Copy, and then Paste in the destination image. This of course creates a floating selection, which I then need to anchor and rename - which is pretty cumbersome. A "Copy layer" command would be very useful.
You can double click the layer name. I use F2 myself in nautilus, is this some kind of standard? It's trivial to add a binding signal for that in GIMP. Also, I recently got rid of some of our default names for new object (wihch seem to be from the stone age). Maybe "foo copy" should die too. But anyway, in order to really add a copy/paste layer feature we'd have to run it through the ui dpt -> enhancement.
There you go with a small improvement: commit 95f14f5de86cf07ae14ba27807b71e9841a14978 Author: Michael Natterer <mitch@gimp.org> Date: Mon Feb 14 20:01:08 2011 +0100 app: add an "edit-name" binding signal and default to F2 app/widgets/gimpcontainertreeview.c | 70 +++++++++++++++++++++++++++++++++++ app/widgets/gimpcontainertreeview.h | 6 +++ 2 files changed, 76 insertions(+), 0 deletions(-)
Thanks, having F2 available will be very handy! I do look forward to having a Copy Layer command :)
*** Bug 693208 has been marked as a duplicate of this bug. ***
This it not only an issue about the layer name, it's also about layer groups, text layers and whatever future layer types. It should be possible to copy/paste them completely, with all information intact. Not too hard to implement either.
*** Bug 694618 has been marked as a duplicate of this bug. ***
This is actually bad enough to count as bug, not enhancement.
*** Bug 701263 has been marked as a duplicate of this bug. ***
Fixed in master: commit 67863dabf92e45ac5bda18c814e893f55d62cc9a Author: Michael Natterer <mitch@gimp.org> Date: Mon Sep 19 23:53:40 2016 +0200 Bug 637313 - Should be possible to copy/paste whole layers in a single step Use the newly added clipboard for entire images to copy/paste layers (we only create single-layer clipboard images, and use only the first layer of any recieved image, the layers can be arbitrarily complex though): - change gimp_edit_copy,cut,paste() to return/take a GimpObject that can be a GimpImage or GimpBuffer - cut/copy the whole layer if there is no selection - always paste layers as new layers, not floating selections - always paste news layers on top of the active layer, where we would attach a floating selection - add enum GimpPasteType { FLOATING, FLOATING_INTO, NEW_LAYER } - add GimpPasteType parameter to gimp_edit_paste() and handle all three cases there because there is now a lot of common code involved - change all callers accordingly, use only legacy buffer pasting from the PDB for now app/actions/buffers-commands.c | 11 +- app/actions/edit-commands.c | 291 ++++++++++++++++++++++------------------------- app/core/core-enums.c | 31 +++++ app/core/core-enums.h | 12 ++ app/core/gimp-edit.c | 180 ++++++++++++++++++++--------- app/core/gimp-edit.h | 8 +- app/display/gimpdisplayshell-dnd.c | 24 ++-- app/pdb/edit-cmds.c | 14 ++- tools/pdbgen/pdb/edit.pdb | 14 ++- 9 files changed, 348 insertions(+), 237 deletions(-)