Start separating the logic for "locked" and "is group" again

The idea that group layers count as locked was a bad one, start adding
separate checks for group layers, and refuse to modify them with
distinct error messages.
This commit is contained in:
Michael Natterer 2009-08-28 20:07:14 +02:00
parent c0785cfc67
commit e979c08133
4 changed files with 34 additions and 3 deletions

View File

@ -167,6 +167,13 @@ gimp_blend_tool_initialize (GimpTool *tool,
return FALSE;
}
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
{
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
_("Cannot modify the pixels of group layers."));
return FALSE;
}
if (gimp_item_get_lock_content (GIMP_ITEM (drawable)))
{
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
@ -355,7 +362,8 @@ gimp_blend_tool_cursor_update (GimpTool *tool,
drawable = gimp_image_get_active_drawable (display->image);
if (gimp_drawable_is_indexed (drawable) ||
if (gimp_drawable_is_indexed (drawable) ||
gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) ||
gimp_item_get_lock_content (GIMP_ITEM (drawable)))
{
modifier = GIMP_CURSOR_MODIFIER_BAD;

View File

@ -128,6 +128,13 @@ gimp_bucket_fill_tool_initialize (GimpTool *tool,
return FALSE;
}
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
{
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
_("Cannot modify the pixels of group layers."));
return FALSE;
}
if (gimp_item_get_lock_content (GIMP_ITEM (drawable)))
{
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
@ -245,7 +252,8 @@ gimp_bucket_fill_tool_cursor_update (GimpTool *tool,
{
GimpDrawable *drawable = gimp_image_get_active_drawable (display->image);
if (! gimp_item_get_lock_content (GIMP_ITEM (drawable)))
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
! gimp_item_get_lock_content (GIMP_ITEM (drawable)))
{
switch (options->fill_mode)
{

View File

@ -269,6 +269,13 @@ gimp_image_map_tool_initialize (GimpTool *tool,
drawable = gimp_image_get_active_drawable (display->image);
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
{
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
_("Cannot modify the pixels of group layers."));
return FALSE;
}
if (gimp_item_get_lock_content (GIMP_ITEM (drawable)))
{
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,

View File

@ -274,6 +274,13 @@ gimp_paint_tool_button_press (GimpTool *tool,
drawable = gimp_image_get_active_drawable (display->image);
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
{
gimp_tool_message_literal (tool, display,
_("Cannot paint on group layers."));
return;
}
if (gimp_item_get_lock_content (GIMP_ITEM (drawable)))
{
gimp_tool_message_literal (tool, display,
@ -533,7 +540,8 @@ gimp_paint_tool_cursor_update (GimpTool *tool,
{
GimpDrawable *drawable = gimp_image_get_active_drawable (display->image);
if (gimp_item_get_lock_content (GIMP_ITEM (drawable)))
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) ||
gimp_item_get_lock_content (GIMP_ITEM (drawable)))
{
modifier = GIMP_CURSOR_MODIFIER_BAD;
toggle_modifier = GIMP_CURSOR_MODIFIER_BAD;