Commit 8b1c3e9d authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/actions/context-actions.c added actions to control the average radius

2005-02-20  Sven Neumann  <sven@gimp.org>

	* app/actions/context-actions.c
	* app/actions/context-commands.c[ch]: added actions to control the
	average radius of color picker tools (bug #167765).

	* app/actions/tool-options-actions.c: fixed a typo in a comment.
parent 995f874a
2005-02-20 Sven Neumann <sven@gimp.org>
* app/actions/context-actions.c
* app/actions/context-commands.c[ch]: added actions to control the
average radius of color picker tools (bug #167765).
* app/actions/tool-options-actions.c: fixed a typo in a comment.
2005-02-20 Manish Singh <yosh@gimp.org>
* plug-ins/pygimp/Makefile.am: attempt to support Win32 (untested).
......
......@@ -612,6 +612,40 @@ static GimpEnumActionEntry context_brush_angle_actions[] =
NULL },
};
static GimpEnumActionEntry context_color_tool_average_radius_actions[] =
{
{ "context-color-tool-average-radius-set", GIMP_STOCK_TOOL_COLOR_PICKER,
"Set Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "context-color-tool-average-radius-minimum", GIMP_STOCK_TOOL_COLOR_PICKER,
"Minumum Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "context-color-tool-average-radius-maximum", GIMP_STOCK_TOOL_COLOR_PICKER,
"Maximum Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "context-color-tool-average-radius-decrease", GIMP_STOCK_TOOL_COLOR_PICKER,
"Decrease Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "context-color-tool-average-radius-increase", GIMP_STOCK_TOOL_COLOR_PICKER,
"Increase Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "context-color-tool-average-radius-decrease-skip",
GIMP_STOCK_TOOL_COLOR_PICKER,
"Decrease Color Picker Radius More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "context-color-tool-average-radius-increase-skip",
GIMP_STOCK_TOOL_COLOR_PICKER,
"Increase Color Picker Radius More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
};
void
context_actions_setup (GimpActionGroup *group)
......@@ -704,6 +738,10 @@ context_actions_setup (GimpActionGroup *group)
context_brush_angle_actions,
G_N_ELEMENTS (context_brush_angle_actions),
G_CALLBACK (context_brush_angle_cmd_callback));
gimp_action_group_add_enum_actions (group,
context_color_tool_average_radius_actions,
G_N_ELEMENTS (context_color_tool_average_radius_actions),
G_CALLBACK (context_color_tool_average_radius_cmd_callback));
}
void
......
......@@ -31,6 +31,9 @@
#include "core/gimpcontext.h"
#include "core/gimpdatafactory.h"
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
#include "tools/gimpcoloroptions.h"
#include "actions.h"
#include "context-commands.h"
......@@ -459,6 +462,38 @@ context_brush_angle_cmd_callback (GtkAction *action,
}
}
void
context_color_tool_average_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_COLOR_OPTIONS (tool_info->tool_options))
{
GimpToolOptions *options = tool_info->tool_options;
GParamSpec *pspec;
gdouble radius;
g_object_get (options, "average-radius", &radius, NULL);
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (options),
"average-radius");
radius = action_select_value ((GimpActionSelectType) value,
radius,
G_PARAM_SPEC_DOUBLE (pspec)->minimum,
G_PARAM_SPEC_DOUBLE (pspec)->maximum,
1.0, 10.0, FALSE);
g_object_set (options, "average-radius", radius, NULL);
}
}
/* private functions */
......
......@@ -90,5 +90,9 @@ void context_brush_angle_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void context_color_tool_average_radius_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif /* __CONTEXT_COMMANDS_H__ */
......@@ -148,7 +148,7 @@ tool_options_actions_update (GimpActionGroup *group,
}
/* privat function */
/* private function */
static void
tool_options_actions_update_presets (GimpActionGroup *group,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment