app/actions/context-actions.c applied modified patch from David Gowers

2006-12-14  Michael Natterer  <mitch@gimp.org>

	* app/actions/context-actions.c
	* app/actions/context-commands.[ch]: applied modified patch from
	David Gowers which adds brush spacing actions. Fixes bug #385679.
This commit is contained in:
Michael Natterer 2006-12-14 12:14:33 +00:00 committed by Michael Natterer
parent 98ae7326d7
commit 5c636cffd7
4 changed files with 65 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2006-12-14 Michael Natterer <mitch@gimp.org>
* app/actions/context-actions.c
* app/actions/context-commands.[ch]: applied modified patch from
David Gowers which adds brush spacing actions. Fixes bug #385679.
2006-12-14 Michael Natterer <mitch@gimp.org>
Applied slightly modified patch from David Gowers which abstracts

View File

@ -846,6 +846,38 @@ static const GimpEnumActionEntry context_font_select_actions[] =
NULL }
};
static const GimpEnumActionEntry context_brush_spacing_actions[] =
{
{ "context-brush-spacing-set", GIMP_STOCK_BRUSH,
"Set Brush Spacing", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-brush-spacing-minimum", GIMP_STOCK_BRUSH,
"Minimum Spacing", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-brush-spacing-maximum", GIMP_STOCK_BRUSH,
"Maximum Spacing", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-brush-spacing-decrease", GIMP_STOCK_BRUSH,
"Decrease Spacing", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-brush-spacing-increase", GIMP_STOCK_BRUSH,
"Increase Spacing", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-brush-spacing-decrease-skip", GIMP_STOCK_BRUSH,
"Decrease Spacing More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-brush-spacing-increase-skip", GIMP_STOCK_BRUSH,
"Increase Spacing More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
static const GimpEnumActionEntry context_brush_shape_actions[] =
{
{ "context-brush-shape-circle", GIMP_STOCK_BRUSH,
@ -1160,6 +1192,10 @@ context_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (context_font_select_actions),
G_CALLBACK (context_font_select_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_brush_spacing_actions,
G_N_ELEMENTS (context_brush_spacing_actions),
G_CALLBACK (context_brush_spacing_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_brush_shape_actions,
G_N_ELEMENTS (context_brush_shape_actions),

View File

@ -470,6 +470,26 @@ context_font_select_cmd_callback (GtkAction *action,
context, context->gimp->fonts);
}
void
context_brush_spacing_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpBrush *brush;
gint spacing;
return_if_no_context (context, data);
brush = gimp_context_get_brush (context);
spacing = gimp_brush_get_spacing (brush);
spacing = action_select_value ((GimpActionSelectType) value,
spacing,
1.0, 5000.0,
1.0, 5.0, 20.0, 0.0, FALSE);
gimp_brush_set_spacing (brush, spacing);
}
void
context_brush_shape_cmd_callback (GtkAction *action,
gint value,

View File

@ -113,6 +113,9 @@ void context_font_select_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_spacing_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_brush_shape_cmd_callback (GtkAction *action,
gint value,
gpointer data);