diff --git a/ChangeLog b/ChangeLog index 74c0431818..87d80763a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-12-14 Michael Natterer + + * 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 Applied slightly modified patch from David Gowers which abstracts diff --git a/app/actions/context-actions.c b/app/actions/context-actions.c index 5e3da16893..6c7c3e0aa9 100644 --- a/app/actions/context-actions.c +++ b/app/actions/context-actions.c @@ -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), diff --git a/app/actions/context-commands.c b/app/actions/context-commands.c index 9cdeba359a..45d4150a76 100644 --- a/app/actions/context-commands.c +++ b/app/actions/context-commands.c @@ -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, diff --git a/app/actions/context-commands.h b/app/actions/context-commands.h index 6937d8c942..55521d7109 100644 --- a/app/actions/context-commands.h +++ b/app/actions/context-commands.h @@ -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);