Commit 696fb34c authored by Jehan's avatar Jehan

app: layers-mask-edit only works with a single layer selected.

parent 897b0952
......@@ -765,7 +765,6 @@ layers_actions_update (GimpActionGroup *group,
GList *layers = NULL;
GList *iter = NULL;
GimpLayer *layer = NULL;
GimpLayerMask *mask = NULL; /* layer mask */
gboolean fs = FALSE; /* floating sel */
gboolean ac = FALSE; /* active channel */
gboolean sel = FALSE;
......@@ -988,8 +987,6 @@ layers_actions_update (GimpActionGroup *group,
gimp_action_group_set_action_active (group, action, TRUE);
mask = gimp_layer_get_mask (layer);
text_layer = gimp_item_is_text_layer (GIMP_ITEM (layer));
}
}
......@@ -1093,7 +1090,7 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-mask-show", n_layers > 0 && !fs && !ac && have_masks);
SET_SENSITIVE ("layers-mask-disable", n_layers > 0 && !fs && !ac && have_masks);
SET_ACTIVE ("layers-mask-edit", mask && gimp_layer_get_edit_mask (layer));
SET_ACTIVE ("layers-mask-edit", n_layers == 1 && have_masks && gimp_layer_get_edit_mask (layers->data));
SET_ACTIVE ("layers-mask-show", all_masks_shown);
SET_ACTIVE ("layers-mask-disable", all_masks_disabled);
......
......@@ -1502,16 +1502,19 @@ layers_mask_edit_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
return_if_no_layer (image, layer, data);
GList *layers;
GList *iter;
gboolean active = g_variant_get_boolean (value);
return_if_no_layers (image, layers, data);
if (gimp_layer_get_mask (layer))
{
gboolean active = g_variant_get_boolean (value);
/* Multiple-layer selection cannot edit masks. */
active = active && (g_list_length (layers) == 1);
gimp_layer_set_edit_mask (layer, active);
gimp_image_flush (image);
}
for (iter = layers; iter; iter = iter->next)
if (gimp_layer_get_mask (iter->data))
gimp_layer_set_edit_mask (iter->data, active);
gimp_image_flush (image);
}
void
......
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