diff --git a/app/tools/gimpcroptool.c b/app/tools/gimpcroptool.c index 9cfb06bca0..6f4225d022 100644 --- a/app/tools/gimpcroptool.c +++ b/app/tools/gimpcroptool.c @@ -165,7 +165,9 @@ gimp_crop_tool_init (GimpCropTool *crop_tool) static void gimp_crop_tool_constructed (GObject *object) { - GimpCropTool *crop_tool = GIMP_CROP_TOOL (object); + GimpTool *tool = GIMP_TOOL (object); + GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool); + GimpCropOptions *options = GIMP_CROP_TOOL_GET_OPTIONS (crop_tool); GimpContext *context; GimpToolInfo *tool_info; @@ -186,6 +188,9 @@ gimp_crop_tool_constructed (GObject *object) gimp_crop_tool_image_changed (crop_tool, gimp_context_get_image (context), context); + + /* The Crop Tool is only destructive when "Delete Pixels" is enabled */ + GIMP_TOOL_GET_CLASS (tool)->is_destructive = options->delete_pixels; } static void @@ -302,7 +307,8 @@ gimp_crop_tool_options_notify (GimpTool *tool, GimpToolOptions *options, const GParamSpec *pspec) { - GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool); + GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool); + GimpCropOptions *crop_options = GIMP_CROP_TOOL_GET_OPTIONS (crop_tool); if (! strcmp (pspec->name, "layer-only") || ! strcmp (pspec->name, "allow-growing")) @@ -317,6 +323,10 @@ gimp_crop_tool_options_notify (GimpTool *tool, gimp_crop_tool_update_option_defaults (crop_tool, FALSE); } } + else if (! strcmp (pspec->name, "delete-pixels")) + { + GIMP_TOOL_GET_CLASS (tool)->is_destructive = crop_options->delete_pixels; + } } static void