app: connect the MyPaint brush radius to the tool tip size action

This commit is contained in:
Michael Natterer 2014-05-03 22:37:30 +02:00
parent 5ccea24952
commit 6ea9b5c3cf
5 changed files with 43 additions and 1 deletions

View File

@ -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),

View File

@ -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,

View File

@ -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);

View File

@ -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);

View File

@ -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-"