Separate checks for "writable" from "is group" when setting sensitivity

This commit is contained in:
Michael Natterer
2009-08-29 12:51:58 +02:00
parent 957cf2cfa9
commit 85c6af5d42
4 changed files with 42 additions and 28 deletions

View File

@ -133,11 +133,12 @@ void
select_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *image = action_data_get_image (data);
GimpImage *image = action_data_get_image (data);
GimpDrawable *drawable = NULL;
gboolean fs = FALSE;
gboolean sel = FALSE;
gboolean writable = FALSE;
gboolean children = FALSE;
if (image)
{
@ -146,6 +147,9 @@ select_actions_update (GimpActionGroup *group,
if (drawable)
{
writable = ! gimp_item_get_lock_content (GIMP_ITEM (drawable));
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
children = TRUE;
}
fs = (gimp_image_get_floating_selection (image) != NULL);
@ -158,7 +162,7 @@ select_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("select-all", drawable);
SET_SENSITIVE ("select-none", drawable && sel);
SET_SENSITIVE ("select-invert", drawable);
SET_SENSITIVE ("select-float", writable && sel);
SET_SENSITIVE ("select-float", writable && !children && sel);
SET_SENSITIVE ("select-feather", drawable && sel);
SET_SENSITIVE ("select-sharpen", drawable && sel);