Commit 32d8cb9a authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/actions/tools-actions.c app/actions/tools-commands.[ch] allow to

2008-03-06  Sven Neumann  <sven@gimp.org>

	* app/actions/tools-actions.c 
	* app/actions/tools-commands.[ch]
	* app/tools/gimptransformtool.c: allow to control the preview
	opacity by actions (defaults to < to > keys).

svn path=/trunk/; revision=25050
parent b870738a
2008-03-06 Sven Neumann <sven@gimp.org>
* app/actions/tools-actions.c
* app/actions/tools-commands.[ch]
* app/tools/gimptransformtool.c: allow to control the preview
opacity by actions (defaults to < to > keys).
2008-03-06 Sven Neumann <sven@gimp.org> 2008-03-06 Sven Neumann <sven@gimp.org>
* app/tools/gimptransformtool.c * app/tools/gimptransformtool.c
......
...@@ -115,11 +115,11 @@ static const GimpEnumActionEntry tools_color_average_radius_actions[] = ...@@ -115,11 +115,11 @@ static const GimpEnumActionEntry tools_color_average_radius_actions[] =
GIMP_ACTION_SELECT_SET, TRUE, GIMP_ACTION_SELECT_SET, TRUE,
NULL }, NULL },
{ "tools-color-average-radius-minimum", GIMP_STOCK_TOOL_COLOR_PICKER, { "tools-color-average-radius-minimum", GIMP_STOCK_TOOL_COLOR_PICKER,
"M Color Picker Radius", NULL, NULL, "Minimize Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE, GIMP_ACTION_SELECT_FIRST, FALSE,
NULL }, NULL },
{ "tools-color-average-radius-maximum", GIMP_STOCK_TOOL_COLOR_PICKER, { "tools-color-average-radius-maximum", GIMP_STOCK_TOOL_COLOR_PICKER,
"Maximum Color Picker Radius", NULL, NULL, "Maximize Color Picker Radius", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE, GIMP_ACTION_SELECT_LAST, FALSE,
NULL }, NULL },
{ "tools-color-average-radius-decrease", GIMP_STOCK_TOOL_COLOR_PICKER, { "tools-color-average-radius-decrease", GIMP_STOCK_TOOL_COLOR_PICKER,
...@@ -149,11 +149,11 @@ static const GimpEnumActionEntry tools_paint_brush_scale_actions[] = ...@@ -149,11 +149,11 @@ static const GimpEnumActionEntry tools_paint_brush_scale_actions[] =
GIMP_ACTION_SELECT_SET, TRUE, GIMP_ACTION_SELECT_SET, TRUE,
NULL }, NULL },
{ "tools-paint-brush-scale-minimum", GIMP_STOCK_TOOL_PAINTBRUSH, { "tools-paint-brush-scale-minimum", GIMP_STOCK_TOOL_PAINTBRUSH,
"M Brush Scale", NULL, NULL, "Minimize Brush Scale", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE, GIMP_ACTION_SELECT_FIRST, FALSE,
NULL }, NULL },
{ "tools-paint-brush-scale-maximum", GIMP_STOCK_TOOL_PAINTBRUSH, { "tools-paint-brush-scale-maximum", GIMP_STOCK_TOOL_PAINTBRUSH,
"Maximum Brush Scale", NULL, NULL, "Maximize Brush Scale", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE, GIMP_ACTION_SELECT_LAST, FALSE,
NULL }, NULL },
{ "tools-paint-brush-scale-decrease", GIMP_STOCK_TOOL_PAINTBRUSH, { "tools-paint-brush-scale-decrease", GIMP_STOCK_TOOL_PAINTBRUSH,
...@@ -181,11 +181,11 @@ static const GimpEnumActionEntry tools_ink_blob_size_actions[] = ...@@ -181,11 +181,11 @@ static const GimpEnumActionEntry tools_ink_blob_size_actions[] =
GIMP_ACTION_SELECT_SET, TRUE, GIMP_ACTION_SELECT_SET, TRUE,
NULL }, NULL },
{ "tools-ink-blob-size-minimum", GIMP_STOCK_TOOL_INK, { "tools-ink-blob-size-minimum", GIMP_STOCK_TOOL_INK,
"M Ink Blob Size", NULL, NULL, "Minimize Ink Blob Size", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE, GIMP_ACTION_SELECT_FIRST, FALSE,
NULL }, NULL },
{ "tools-ink-blob-size-maximum", GIMP_STOCK_TOOL_INK, { "tools-ink-blob-size-maximum", GIMP_STOCK_TOOL_INK,
"Maximum Ink Blob Size", NULL, NULL, "Maximize Ink Blob Size", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE, GIMP_ACTION_SELECT_LAST, FALSE,
NULL }, NULL },
{ "tools-ink-blob-size-decrease", GIMP_STOCK_TOOL_INK, { "tools-ink-blob-size-decrease", GIMP_STOCK_TOOL_INK,
...@@ -213,11 +213,11 @@ static const GimpEnumActionEntry tools_ink_blob_aspect_actions[] = ...@@ -213,11 +213,11 @@ static const GimpEnumActionEntry tools_ink_blob_aspect_actions[] =
GIMP_ACTION_SELECT_SET, TRUE, GIMP_ACTION_SELECT_SET, TRUE,
NULL }, NULL },
{ "tools-ink-blob-aspect-minimum", GIMP_STOCK_TOOL_INK, { "tools-ink-blob-aspect-minimum", GIMP_STOCK_TOOL_INK,
"M Ink Blob Aspect", NULL, NULL, "Minimize Ink Blob Aspect", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE, GIMP_ACTION_SELECT_FIRST, FALSE,
NULL }, NULL },
{ "tools-ink-blob-aspect-maximum", GIMP_STOCK_TOOL_INK, { "tools-ink-blob-aspect-maximum", GIMP_STOCK_TOOL_INK,
"Maximum Ink Blob Aspect", NULL, NULL, "Maximize Ink Blob Aspect", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE, GIMP_ACTION_SELECT_LAST, FALSE,
NULL }, NULL },
{ "tools-ink-blob-aspect-decrease", GIMP_STOCK_TOOL_INK, { "tools-ink-blob-aspect-decrease", GIMP_STOCK_TOOL_INK,
...@@ -245,11 +245,11 @@ static const GimpEnumActionEntry tools_ink_blob_angle_actions[] = ...@@ -245,11 +245,11 @@ static const GimpEnumActionEntry tools_ink_blob_angle_actions[] =
GIMP_ACTION_SELECT_SET, TRUE, GIMP_ACTION_SELECT_SET, TRUE,
NULL }, NULL },
{ "tools-ink-blob-angle-minimum", GIMP_STOCK_TOOL_INK, { "tools-ink-blob-angle-minimum", GIMP_STOCK_TOOL_INK,
"M Ink Blob Angle", NULL, NULL, "Minimize Ink Blob Angle", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE, GIMP_ACTION_SELECT_FIRST, FALSE,
NULL }, NULL },
{ "tools-ink-blob-angle-maximum", GIMP_STOCK_TOOL_INK, { "tools-ink-blob-angle-maximum", GIMP_STOCK_TOOL_INK,
"Maximum Ink Blob Angle", NULL, NULL, "Maximize Ink Blob Angle", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE, GIMP_ACTION_SELECT_LAST, FALSE,
NULL }, NULL },
{ "tools-ink-blob-angle-decrease", GIMP_STOCK_TOOL_INK, { "tools-ink-blob-angle-decrease", GIMP_STOCK_TOOL_INK,
...@@ -279,12 +279,12 @@ static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] = ...@@ -279,12 +279,12 @@ static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] =
NULL }, NULL },
{ "tools-foreground-select-brush-size-minimum", { "tools-foreground-select-brush-size-minimum",
GIMP_STOCK_TOOL_FOREGROUND_SELECT, GIMP_STOCK_TOOL_FOREGROUND_SELECT,
"M Foreground Select Brush Size", NULL, NULL, "Minimize Foreground Select Brush Size", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE, GIMP_ACTION_SELECT_FIRST, FALSE,
NULL }, NULL },
{ "tools-foreground-select-brush-size-maximum", { "tools-foreground-select-brush-size-maximum",
GIMP_STOCK_TOOL_FOREGROUND_SELECT, GIMP_STOCK_TOOL_FOREGROUND_SELECT,
"Maximum Foreground Select Brush Size", NULL, NULL, "Maximize Foreground Select Brush Size", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE, GIMP_ACTION_SELECT_LAST, FALSE,
NULL }, NULL },
{ "tools-foreground-select-brush-size-decrease", { "tools-foreground-select-brush-size-decrease",
...@@ -309,6 +309,38 @@ static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] = ...@@ -309,6 +309,38 @@ static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] =
NULL }, NULL },
}; };
static const GimpEnumActionEntry tools_transform_preview_opacity_actions[] =
{
{ "tools-transform-preview-opacity-set", GIMP_STOCK_TOOL_PERSPECTIVE,
"Set Transform Tool Preview Opacity", NULL, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-transform-preview-opacity-minimum", GIMP_STOCK_TOOL_PERSPECTIVE,
"Minimize Transform Tool Preview Opacity", NULL, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-transform-preview-opacity-maximum", GIMP_STOCK_TOOL_PERSPECTIVE,
"Maximize Transform Tool Preview Opacity", NULL, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-transform-preview-opacity-decrease", GIMP_STOCK_TOOL_PERSPECTIVE,
"Decrease Transform Tool Preview Opacity", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "tools-transform-preview-opacity-increase", GIMP_STOCK_TOOL_PERSPECTIVE,
"Increase Transform Tool Preview Opacity", NULL, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "tools-transform-preview-opacity-decrease-skip", GIMP_STOCK_TOOL_PERSPECTIVE,
"Decrease Transform Tool Preview Opacity More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "tools-transform-preview-opacity-increase-skip", GIMP_STOCK_TOOL_PERSPECTIVE,
"Increase Transform Tool Preview Opacity More", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
};
static const GimpEnumActionEntry tools_value_1_actions[] = static const GimpEnumActionEntry tools_value_1_actions[] =
{ {
{ "tools-value-1-set", GIMP_STOCK_TOOL_OPTIONS, { "tools-value-1-set", GIMP_STOCK_TOOL_OPTIONS,
...@@ -537,6 +569,11 @@ tools_actions_setup (GimpActionGroup *group) ...@@ -537,6 +569,11 @@ tools_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (tools_foreground_select_brush_size_actions), G_N_ELEMENTS (tools_foreground_select_brush_size_actions),
G_CALLBACK (tools_fg_select_brush_size_cmd_callback)); G_CALLBACK (tools_fg_select_brush_size_cmd_callback));
gimp_action_group_add_enum_actions (group,
tools_transform_preview_opacity_actions,
G_N_ELEMENTS (tools_transform_preview_opacity_actions),
G_CALLBACK (tools_transform_preview_opacity_cmd_callback));
gimp_action_group_add_enum_actions (group, gimp_action_group_add_enum_actions (group,
tools_value_1_actions, tools_value_1_actions,
G_N_ELEMENTS (tools_value_1_actions), G_N_ELEMENTS (tools_value_1_actions),
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "tools/gimprectangleoptions.h" #include "tools/gimprectangleoptions.h"
#include "tools/gimpimagemaptool.h" #include "tools/gimpimagemaptool.h"
#include "tools/gimptoolcontrol.h" #include "tools/gimptoolcontrol.h"
#include "tools/gimptransformoptions.h"
#include "tools/tool_manager.h" #include "tools/tool_manager.h"
#include "actions.h" #include "actions.h"
...@@ -372,6 +373,26 @@ tools_fg_select_brush_size_cmd_callback (GtkAction *action, ...@@ -372,6 +373,26 @@ tools_fg_select_brush_size_cmd_callback (GtkAction *action,
} }
} }
void
tools_transform_preview_opacity_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_TRANSFORM_OPTIONS (tool_info->tool_options))
{
action_select_property ((GimpActionSelectType) value,
G_OBJECT (tool_info->tool_options),
"preview-opacity",
0.01, 0.1, 0.5, FALSE);
}
}
void void
tools_value_1_cmd_callback (GtkAction *action, tools_value_1_cmd_callback (GtkAction *action,
gint value, gint value,
......
...@@ -59,6 +59,9 @@ void tools_ink_blob_angle_cmd_callback (GtkAction *action, ...@@ -59,6 +59,9 @@ void tools_ink_blob_angle_cmd_callback (GtkAction *action,
void tools_fg_select_brush_size_cmd_callback (GtkAction *action, void tools_fg_select_brush_size_cmd_callback (GtkAction *action,
gint value, gint value,
gpointer data); gpointer data);
void tools_transform_preview_opacity_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void tools_value_1_cmd_callback (GtkAction *action, void tools_value_1_cmd_callback (GtkAction *action,
gint value, gint value,
......
...@@ -191,10 +191,11 @@ gimp_transform_tool_class_init (GimpTransformToolClass *klass) ...@@ -191,10 +191,11 @@ gimp_transform_tool_class_init (GimpTransformToolClass *klass)
static void static void
gimp_transform_tool_init (GimpTransformTool *tr_tool) gimp_transform_tool_init (GimpTransformTool *tr_tool)
{ {
GimpTool *tool; GimpTool *tool = GIMP_TOOL (tr_tool);
gint i; gint i;
tool = GIMP_TOOL (tr_tool); gimp_tool_control_set_action_value_1 (tool->control,
"tools/tools-transform-preview-opacity-set");
gimp_tool_control_set_scroll_lock (tool->control, TRUE); gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_preserve (tool->control, FALSE); gimp_tool_control_set_preserve (tool->control, FALSE);
......
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