diff --git a/app/actions/tools-actions.c b/app/actions/tools-actions.c index 26fb26e13b..e94bec1fad 100644 --- a/app/actions/tools-actions.c +++ b/app/actions/tools-actions.c @@ -185,6 +185,14 @@ static const GimpEnumActionEntry tools_airbrush_flow_actions[] = NULL } }; +static const GimpEnumActionEntry tools_mybrush_radius_actions[] = +{ + { "tools-mybrush-radius-set", GIMP_STOCK_TOOL_MYBRUSH, + "Set MyPaint Brush Radius", NULL, NULL, + GIMP_ACTION_SELECT_SET, TRUE, + NULL } +}; + static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] = { { "tools-foreground-select-brush-size-set", @@ -497,6 +505,11 @@ tools_actions_setup (GimpActionGroup *group) G_N_ELEMENTS (tools_airbrush_flow_actions), G_CALLBACK (tools_airbrush_flow_cmd_callback)); + gimp_action_group_add_enum_actions (group, NULL, + tools_mybrush_radius_actions, + G_N_ELEMENTS (tools_mybrush_radius_actions), + G_CALLBACK (tools_mybrush_radius_cmd_callback)); + gimp_action_group_add_enum_actions (group, NULL, tools_foreground_select_brush_size_actions, G_N_ELEMENTS (tools_foreground_select_brush_size_actions), diff --git a/app/actions/tools-commands.c b/app/actions/tools-commands.c index 93a707180f..605c93df64 100644 --- a/app/actions/tools-commands.c +++ b/app/actions/tools-commands.c @@ -31,6 +31,7 @@ #include "paint/gimpinkoptions.h" #include "paint/gimpairbrushoptions.h" +#include "paint/gimpmybrushoptions.h" #include "widgets/gimpenumaction.h" #include "widgets/gimpuimanager.h" @@ -293,6 +294,27 @@ tools_airbrush_flow_cmd_callback (GtkAction *action, } } +void +tools_mybrush_radius_cmd_callback (GtkAction *action, + gint value, + gpointer data) +{ + GimpContext *context; + GimpToolInfo *tool_info; + return_if_no_context (context, data); + + tool_info = gimp_context_get_tool (context); + + if (tool_info && GIMP_IS_MYBRUSH_OPTIONS (tool_info->tool_options)) + { + action_select_property ((GimpActionSelectType) value, + action_data_get_display (data), + G_OBJECT (tool_info->tool_options), + "radius", + 0.1, 0.1, 0.5, 1.0, FALSE); + } +} + void tools_fg_select_brush_size_cmd_callback (GtkAction *action, gint value, diff --git a/app/actions/tools-commands.h b/app/actions/tools-commands.h index ddabf76e6a..24c2de5199 100644 --- a/app/actions/tools-commands.h +++ b/app/actions/tools-commands.h @@ -54,6 +54,10 @@ void tools_airbrush_flow_cmd_callback (GtkAction *action, gint value, gpointer data); +void tools_mybrush_radius_cmd_callback (GtkAction *action, + gint value, + gpointer data); + void tools_fg_select_brush_size_cmd_callback (GtkAction *action, gint value, gpointer data); diff --git a/app/tools/gimpmybrushtool.c b/app/tools/gimpmybrushtool.c index b436bbd3c1..5e31ac2855 100644 --- a/app/tools/gimpmybrushtool.c +++ b/app/tools/gimpmybrushtool.c @@ -80,7 +80,9 @@ gimp_mybrush_tool_init (GimpMybrushTool *mybrush_tool) { GimpTool *tool = GIMP_TOOL (mybrush_tool); - gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_INK); + gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_INK); + gimp_tool_control_set_action_size (tool->control, + "tools/tools-mybrush-radius-set"); gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (mybrush_tool), GIMP_COLOR_PICK_MODE_FOREGROUND); diff --git a/app/widgets/gimpaction.c b/app/widgets/gimpaction.c index 535963f464..1d5b2d17bc 100644 --- a/app/widgets/gimpaction.c +++ b/app/widgets/gimpaction.c @@ -330,6 +330,7 @@ gimp_action_is_gui_blacklisted (const gchar *action_name) "tools-ink-blob-size-", "tools-ink-blob-aspect-", "tools-ink-blob-angle-", + "tools-mybrush-radius-", "tools-foreground-select-brush-size-", "tools-transform-preview-opacity-", "tools-warp-effect-size-"