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-border", drawable && sel);
|
||||||
|
|
||||||
SET_SENSITIVE ("select-save", drawable && !fs);
|
SET_SENSITIVE ("select-save", drawable && !fs);
|
||||||
SET_SENSITIVE ("select-stroke", writable && sel);
|
SET_SENSITIVE ("select-stroke", writable && !children && sel);
|
||||||
SET_SENSITIVE ("select-stroke-last-values", writable && sel);
|
SET_SENSITIVE ("select-stroke-last-values", writable && !children && sel);
|
||||||
|
|
||||||
#undef SET_SENSITIVE
|
#undef SET_SENSITIVE
|
||||||
}
|
}
|
||||||
|
@ -243,18 +243,21 @@ void
|
|||||||
vectors_actions_update (GimpActionGroup *group,
|
vectors_actions_update (GimpActionGroup *group,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *image = action_data_get_image (data);
|
GimpImage *image = action_data_get_image (data);
|
||||||
GimpVectors *vectors = NULL;
|
GimpVectors *vectors = NULL;
|
||||||
gint n_vectors = 0;
|
GimpDrawable *drawable = NULL;
|
||||||
gboolean mask_empty = TRUE;
|
gint n_vectors = 0;
|
||||||
gboolean global_buf = FALSE;
|
gboolean mask_empty = TRUE;
|
||||||
gboolean visible = FALSE;
|
gboolean global_buf = FALSE;
|
||||||
gboolean linked = FALSE;
|
gboolean visible = FALSE;
|
||||||
gboolean locked = FALSE;
|
gboolean linked = FALSE;
|
||||||
gboolean can_lock = FALSE;
|
gboolean locked = FALSE;
|
||||||
gboolean writable = FALSE;
|
gboolean can_lock = FALSE;
|
||||||
GList *next = NULL;
|
gboolean writable = FALSE;
|
||||||
GList *prev = NULL;
|
gboolean dr_writable = FALSE;
|
||||||
|
gboolean dr_children = FALSE;
|
||||||
|
GList *next = NULL;
|
||||||
|
GList *prev = NULL;
|
||||||
|
|
||||||
if (image)
|
if (image)
|
||||||
{
|
{
|
||||||
@ -286,6 +289,18 @@ vectors_actions_update (GimpActionGroup *group,
|
|||||||
next = g_list_next (list);
|
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) \
|
#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", image && !mask_empty);
|
||||||
SET_SENSITIVE ("vectors-selection-to-vectors-short", 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-selection-to-vectors-advanced", image && !mask_empty);
|
||||||
SET_SENSITIVE ("vectors-stroke", vectors);
|
SET_SENSITIVE ("vectors-stroke", vectors &&
|
||||||
SET_SENSITIVE ("vectors-stroke-last-values", 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-replace", vectors);
|
||||||
SET_SENSITIVE ("vectors-selection-from-vectors", vectors);
|
SET_SENSITIVE ("vectors-selection-from-vectors", vectors);
|
||||||
|
Reference in New Issue
Block a user