I've always hated the way that worked, I've got a script that deletes
the active layer, then sets the layer underneath it to active if anyone
wants to use it...
# -*- coding: utf-8 -*-
# delete-layer.py - Version 1.0
# Copyright (C) 07/11/2008 by Jerry Baker <jba...@gimpthoughts.com>
# Deletes active layer then selects the layer underneath.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# --- Imports
from gimpfu import *
gettext.install("gimp20-python", gimp.locale_directory, unicode=True)
def delete_layer(image, drawable):
layer_index = image.layers.index(image.active_layer)
if layer_index == (len(image.layers)-1):
layer_index -= 1
if layer_index >= 0:
image.active_layer = image.layers[layer_index]
N_("Deletes active layer then selects the layer underneath."),
"Deletes active layer then selects the layer underneath.",
N_("Delete Active Layer"),
"RGB*, GRAY*, INDEXED*",
# --- Parameters
(PF_IMAGE, "image", _("Image"), None),
(PF_DRAWABLE, "layer", _("Drawable"), None),
# --- Results
On 03/05/2010 02:22 PM, Martin Nordholts wrote:
> On 03/05/2010 03:20 AM, Luiz Felipe Moraes Pereira wrote:
>> Hi again, the original discussion is in the link below:
>> I was advised to present this idea here, what do you think?
>> Also I do not mind much about not having a selected layer after
>> the deletion of a layer. But the forced viewer scroll down( or up ),
>> depending of the last selected layer is a problem.
> To me, having the layers dialog scroll to a seemingly random place after
> deleting a layer is a clear usability problem. A user should not have to
> worry about what layer that was previously selected when deleting a layer.
> / Martin
Gimp-developer mailing list