Commit 7ce77c47 authored by Michael Natterer's avatar Michael Natterer 😴

app: stop hardcoding NORMAL_LEGACY for new layers/images

Use GimpCoreConfig::default-new-layer-mode instead.
parent a256cf33
......@@ -396,7 +396,7 @@ layers_new_last_vals_cmd_callback (GtkAction *action,
off_x = 0;
off_y = 0;
opacity = 1.0;
mode = GIMP_LAYER_MODE_NORMAL_LEGACY;
mode = image->gimp->config->default_new_layer_mode;
}
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
......@@ -442,7 +442,7 @@ layers_new_from_visible_cmd_callback (GtkAction *action,
TRUE),
_("Visible"),
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY,
image->gimp->config->default_new_layer_mode,
profile);
gimp_image_add_layer (image, layer, GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
......
......@@ -28,6 +28,8 @@
#include "core-types.h"
#include "config/gimpcoreconfig.h"
#include "gegl/gimp-gegl-utils.h"
#include "gimp.h"
......@@ -421,7 +423,7 @@ gimp_edit_paste (GimpImage *image,
floating_format,
_("Pasted Layer"),
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY);
image->gimp->config->default_new_layer_mode);
}
if (! layer)
......
......@@ -30,6 +30,8 @@
#include "core-types.h"
#include "config/gimpcoreconfig.h"
#include "gegl/gimp-gegl-apply-operation.h"
#include "gegl/gimp-gegl-utils.h"
......@@ -1013,7 +1015,7 @@ gimp_drawable_transform_paste (GimpDrawable *drawable,
gimp_drawable_get_format_with_alpha (drawable),
_("Transformation"),
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY,
image->gimp->config->default_new_layer_mode,
buffer_profile);
gimp_item_set_offset (GIMP_ITEM (layer), offset_x, offset_y);
......
......@@ -27,6 +27,8 @@
#include "core-types.h"
#include "config/gimpcoreconfig.h"
#include "gegl/gimp-babl-compat.h"
#include "gegl/gimp-gegl-apply-operation.h"
#include "gegl/gimp-gegl-nodes.h"
......@@ -527,7 +529,7 @@ gimp_image_merge_layers (GimpImage *image,
gimp_image_get_layer_format (image, FALSE),
gimp_object_get_name (bottom_layer),
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY);
image->gimp->config->default_new_layer_mode);
if (! merge_layer)
{
......@@ -557,7 +559,7 @@ gimp_image_merge_layers (GimpImage *image,
gimp_drawable_get_format_with_alpha (GIMP_DRAWABLE (bottom_layer)),
gimp_object_get_name (bottom_layer),
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY);
image->gimp->config->default_new_layer_mode);
if (! merge_layer)
{
......
......@@ -149,7 +149,7 @@ gimp_image_new_from_template (Gimp *gimp,
gimp_image_get_layer_format (image, has_alpha),
_("Background"),
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY);
image->gimp->config->default_new_layer_mode);
gimp_drawable_fill (GIMP_DRAWABLE (layer),
context, gimp_template_get_fill_type (template));
......@@ -224,7 +224,9 @@ gimp_image_new_from_drawable (Gimp *gimp,
gimp_item_translate (GIMP_ITEM (new_layer), -off_x, -off_y, FALSE);
gimp_item_set_visible (GIMP_ITEM (new_layer), TRUE, FALSE);
gimp_item_set_linked (GIMP_ITEM (new_layer), FALSE, FALSE);
gimp_layer_set_mode (new_layer, GIMP_LAYER_MODE_NORMAL_LEGACY, FALSE);
gimp_layer_set_mode (new_layer,
new_image->gimp->config->default_new_layer_mode,
FALSE);
gimp_layer_set_opacity (new_layer, GIMP_OPACITY_OPAQUE, FALSE);
if (gimp_layer_can_lock_alpha (new_layer))
gimp_layer_set_lock_alpha (new_layer, FALSE, FALSE);
......@@ -322,7 +324,7 @@ gimp_image_new_from_buffer (Gimp *gimp,
has_alpha),
_("Pasted Layer"),
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY);
image->gimp->config->default_new_layer_mode);
gimp_image_add_layer (image, layer, NULL, 0, TRUE);
......@@ -381,7 +383,7 @@ gimp_image_new_from_pixbuf (Gimp *gimp,
has_alpha),
layer_name,
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY);
new_image->gimp->config->default_new_layer_mode);
gimp_image_add_layer (new_image, layer, NULL, 0, TRUE);
......
......@@ -25,6 +25,8 @@
#include "core-types.h"
#include "config/gimpcoreconfig.h"
#include "gegl/gimp-babl.h"
#include "gegl/gimp-gegl-apply-operation.h"
......@@ -891,7 +893,7 @@ gimp_selection_float (GimpSelection *selection,
gimp_drawable_get_format_with_alpha (drawable),
_("Floated Layer"),
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY,
image->gimp->config->default_new_layer_mode,
profile);
/* Set the offsets */
......
......@@ -27,6 +27,8 @@
#include "display-types.h"
#include "config/gimpcoreconfig.h"
#include "core/gimp.h"
#include "core/gimp-edit.h"
#include "core/gimpbuffer.h"
......@@ -723,7 +725,7 @@ gimp_display_shell_drop_pixbuf (GtkWidget *widget,
gimp_image_get_layer_format (image, has_alpha),
_("Dropped Buffer"),
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY);
image->gimp->config->default_new_layer_mode);
if (new_layer)
{
......
......@@ -32,6 +32,7 @@
#include "pdb-types.h"
#include "config/gimpcoreconfig.h"
#include "core/gimp.h"
#include "core/gimpdrawable.h"
#include "core/gimpgrouplayer.h"
......@@ -182,7 +183,7 @@ layer_new_from_visible_invoker (GimpProcedure *procedure,
TRUE),
name,
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY,
gimp->config->default_new_layer_mode,
profile);
}
......
......@@ -29,6 +29,8 @@
#include "tools-types.h"
#include "config/gimpcoreconfig.h"
#include "gegl/gimp-gegl-apply-operation.h"
#include "core/gimp.h"
......@@ -1106,7 +1108,7 @@ gimp_warp_tool_animate (GimpWarpTool *wt)
gimp_item_set_offset (GIMP_ITEM (layer), 0, 0);
gimp_item_set_visible (GIMP_ITEM (layer), TRUE, FALSE);
gimp_layer_set_mode (layer, GIMP_LAYER_MODE_NORMAL_LEGACY, FALSE);
gimp_layer_set_mode (layer, image->gimp->config->default_new_layer_mode, FALSE);
gimp_layer_set_opacity (layer, GIMP_OPACITY_OPAQUE, FALSE);
gimp_image_add_layer (image, layer, NULL, 0, FALSE);
......
......@@ -31,6 +31,8 @@
#include "widgets-types.h"
#include "config/gimpcoreconfig.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpimage-undo.h"
......@@ -809,7 +811,7 @@ gimp_layer_tree_view_drop_pixbuf (GimpContainerTreeView *tree_view,
gimp_image_get_layer_format (image, TRUE),
_("Dropped Buffer"),
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY);
image->gimp->config->default_new_layer_mode);
gimp_image_add_layer (image, new_layer, parent, index, TRUE);
......@@ -851,7 +853,7 @@ gimp_layer_tree_view_item_new (GimpImage *image)
gimp_image_get_layer_format (image, TRUE),
NULL,
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY);
image->gimp->config->default_new_layer_mode);
gimp_image_add_layer (image, new_layer,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
......
......@@ -156,7 +156,7 @@ HELP
TRUE),
name,
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL_LEGACY,
gimp->config->default_new_layer_mode,
profile);
}
CODE
......@@ -1357,6 +1357,7 @@ CODE
@headers = qw(<cairo.h>
"libgimpbase/gimpbase.h"
"libgimpcolor/gimpcolor.h"
"config/gimpcoreconfig.h"
"core/gimp.h"
"core/gimpimage-color-profile.h"
"core/gimpimage-undo.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment