Don't allow stroking to locked items and group items
This commit is contained in:
@ -171,8 +171,8 @@ select_actions_update (GimpActionGroup *group,
|
||||
SET_SENSITIVE ("select-border", drawable && sel);
|
||||
|
||||
SET_SENSITIVE ("select-save", drawable && !fs);
|
||||
SET_SENSITIVE ("select-stroke", writable && sel);
|
||||
SET_SENSITIVE ("select-stroke-last-values", writable && sel);
|
||||
SET_SENSITIVE ("select-stroke", writable && !children && sel);
|
||||
SET_SENSITIVE ("select-stroke-last-values", writable && !children && sel);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
}
|
||||
|
@ -245,6 +245,7 @@ vectors_actions_update (GimpActionGroup *group,
|
||||
{
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
GimpVectors *vectors = NULL;
|
||||
GimpDrawable *drawable = NULL;
|
||||
gint n_vectors = 0;
|
||||
gboolean mask_empty = TRUE;
|
||||
gboolean global_buf = FALSE;
|
||||
@ -253,6 +254,8 @@ vectors_actions_update (GimpActionGroup *group,
|
||||
gboolean locked = FALSE;
|
||||
gboolean can_lock = FALSE;
|
||||
gboolean writable = FALSE;
|
||||
gboolean dr_writable = FALSE;
|
||||
gboolean dr_children = FALSE;
|
||||
GList *next = NULL;
|
||||
GList *prev = NULL;
|
||||
|
||||
@ -286,6 +289,18 @@ vectors_actions_update (GimpActionGroup *group,
|
||||
next = g_list_next (list);
|
||||
}
|
||||
}
|
||||
|
||||
drawable = gimp_image_get_active_drawable (image);
|
||||
|
||||
if (drawable)
|
||||
{
|
||||
GimpItem *item = GIMP_ITEM (drawable);
|
||||
|
||||
dr_writable = ! gimp_item_is_content_locked (item);
|
||||
|
||||
if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
|
||||
dr_children = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
#define SET_SENSITIVE(action,condition) \
|
||||
@ -323,8 +338,12 @@ vectors_actions_update (GimpActionGroup *group,
|
||||
SET_SENSITIVE ("vectors-selection-to-vectors", image && !mask_empty);
|
||||
SET_SENSITIVE ("vectors-selection-to-vectors-short", image && !mask_empty);
|
||||
SET_SENSITIVE ("vectors-selection-to-vectors-advanced", image && !mask_empty);
|
||||
SET_SENSITIVE ("vectors-stroke", vectors);
|
||||
SET_SENSITIVE ("vectors-stroke-last-values", vectors);
|
||||
SET_SENSITIVE ("vectors-stroke", vectors &&
|
||||
dr_writable &&
|
||||
!dr_children);
|
||||
SET_SENSITIVE ("vectors-stroke-last-values", vectors &&
|
||||
dr_writable &&
|
||||
!dr_children);
|
||||
|
||||
SET_SENSITIVE ("vectors-selection-replace", vectors);
|
||||
SET_SENSITIVE ("vectors-selection-from-vectors", vectors);
|
||||
|
Reference in New Issue
Block a user