Commit a54a6b16 authored by Raphael Quinet's avatar Raphael Quinet Committed by Raphaël Quinet

app/widgets/gimpwidgets-utils.h New utility function to build status bar

2006-08-02  Raphael Quinet  <raphael@gimp.org>

	* app/widgets/gimpwidgets-utils.h
	* app/widgets/gimpwidgets-utils.c (gimp_suggest_modifiers):
	New utility function to build status bar messages while allowing
	dynamic names for the modifiers.

	* app/tools/gimppainttool.h
	* app/tools/gimppainttool.c: Added new members to the class in
	order to allow paint tools to set different status messages for
	the normal case or when drawing a line.

	* app/tools/gimpclonetool.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimperasertool.c
	* app/tools/gimpsmudgetool.c: Use the new functions to set
	appropriate messages in the status bar.  Still work in progress,
	partial fix for bug #124040.

	* app/tools/gimpvectortool.c: Use gimp_suggest_modifiers().
parent 90c342cc
2006-08-02 Raphaël Quinet <raphael@gimp.org>
* app/widgets/gimpwidgets-utils.h
* app/widgets/gimpwidgets-utils.c (gimp_suggest_modifiers):
New utility function to build status bar messages while allowing
dynamic names for the modifiers.
* app/tools/gimppainttool.h
* app/tools/gimppainttool.c: Added new members to the class in
order to allow paint tools to set different status messages for
the normal case or when drawing a line.
* app/tools/gimpclonetool.c
* app/tools/gimpconvolvetool.c
* app/tools/gimpdodgeburntool.c
* app/tools/gimperasertool.c
* app/tools/gimpsmudgetool.c: Use the new functions to set
appropriate messages in the status bar. Still work in progress,
partial fix for bug #124040.
* app/tools/gimpvectortool.c: Use gimp_suggest_modifiers().
2006-07-31 Karine Delvare <edhel@gimp.org>
* app/tools/gimprectangletool.c: Applied patch from Karl Günter
......
......@@ -44,6 +44,7 @@
#include "paint/gimppaintoptions.h"
#include "widgets/gimpdevices.h"
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
......@@ -162,6 +163,10 @@ gimp_paint_tool_init (GimpPaintTool *paint_tool)
paint_tool->pick_colors = FALSE;
paint_tool->draw_line = FALSE;
paint_tool->status = _("Click to paint.");
paint_tool->status_line = _("Click to draw the line.");
paint_tool->status_ctrl = _("%s to pick a color");
paint_tool->show_cursor = TRUE;
paint_tool->draw_brush = TRUE;
paint_tool->brush_x = 0.0;
......@@ -542,9 +547,23 @@ gimp_paint_tool_modifier_key (GimpTool *tool,
gimp_color_tool_enable (GIMP_COLOR_TOOL (tool),
GIMP_COLOR_OPTIONS (info->tool_options));
gimp_tool_push_status (tool, display,
_("Click in any image to pick the "
"foreground color."));
switch (GIMP_COLOR_TOOL (tool)->pick_mode)
{
case GIMP_COLOR_PICK_MODE_FOREGROUND:
gimp_tool_push_status (tool, display,
_("Click in any image to pick the "
"foreground color."));
break;
case GIMP_COLOR_PICK_MODE_BACKGROUND:
gimp_tool_push_status (tool, display,
_("Click in any image to pick the "
"background color."));
break;
default:
break;
}
}
}
else
......@@ -615,7 +634,7 @@ gimp_paint_tool_oper_update (GimpTool *tool,
gdouble dx, dy, dist;
gchar status_str[STATUSBAR_SIZE];
const gchar *status_help;
gchar *status_help;
gint off_x, off_y;
gboolean hard;
......@@ -633,11 +652,11 @@ gimp_paint_tool_oper_update (GimpTool *tool,
dx = core->cur_coords.x - core->last_coords.x;
dy = core->cur_coords.y - core->last_coords.y;
if ((state & GDK_CONTROL_MASK))
status_help = _("Click to draw the line.");
else
status_help = _("Click to draw the line."
" (try Ctrl for constrained angles)");
status_help = gimp_suggest_modifiers (paint_tool->status_line,
GDK_CONTROL_MASK & ~state,
NULL,
_("%s for constrained angles"),
NULL);
/* show distance in statusbar */
if (shell->unit == GIMP_UNIT_PIXEL)
......@@ -663,22 +682,30 @@ gimp_paint_tool_oper_update (GimpTool *tool,
g_snprintf (status_str, sizeof (status_str), format_str, dist,
status_help);
}
g_free (status_help);
gimp_tool_push_status (tool, display, status_str);
paint_tool->draw_line = TRUE;
}
else
{
gchar *status;
if (display == tool->display)
gimp_tool_push_status (tool, display,
_("Click to paint. (try "
"Shift for a straight line, "
"Ctrl to pick a color)"));
status = gimp_suggest_modifiers (paint_tool->status,
(GDK_SHIFT_MASK
| GDK_CONTROL_MASK) & ~state,
_("%s for a straight line"),
paint_tool->status_ctrl,
NULL);
else
gimp_tool_push_status (tool, display,
_("Click to paint. (try "
"Ctrl to pick a color)"));
status = gimp_suggest_modifiers (paint_tool->status,
GDK_CONTROL_MASK & ~state,
NULL,
paint_tool->status_ctrl,
NULL);
gimp_tool_push_status (tool, display, status);
g_free (status);
paint_tool->draw_line = FALSE;
}
......
......@@ -45,6 +45,10 @@ struct _GimpPaintTool
gdouble brush_x;
gdouble brush_y;
const gchar *status; /* status message */
const gchar *status_line; /* status message when drawing a line */
const gchar *status_ctrl; /* additional message for the ctrl modifier */
GimpPaintCore *core;
};
......
......@@ -70,6 +70,11 @@ static void gimp_clone_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display);
static void gimp_clone_tool_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display);
static void gimp_clone_tool_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
......@@ -115,8 +120,9 @@ gimp_clone_tool_class_init (GimpCloneToolClass *klass)
tool_class->control = gimp_clone_tool_control;
tool_class->button_press = gimp_clone_tool_button_press;
tool_class->motion = gimp_clone_tool_motion;
tool_class->cursor_update = gimp_clone_tool_cursor_update;
tool_class->modifier_key = gimp_clone_tool_modifier_key;
tool_class->oper_update = gimp_clone_tool_oper_update;
tool_class->cursor_update = gimp_clone_tool_cursor_update;
draw_tool_class->draw = gimp_clone_tool_draw;
}
......@@ -124,12 +130,16 @@ gimp_clone_tool_class_init (GimpCloneToolClass *klass)
static void
gimp_clone_tool_init (GimpCloneTool *clone)
{
GimpTool *tool = GIMP_TOOL (clone);
GimpTool *tool = GIMP_TOOL (clone);
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_CLONE);
gimp_tool_control_set_action_object_2 (tool->control,
"context/context-pattern-select-set");
paint_tool->status = _("Click to clone.");
paint_tool->status_ctrl = _("%s to set a new clone source");
}
static gboolean
......@@ -259,6 +269,31 @@ gimp_clone_tool_motion (GimpTool *tool,
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
}
static void
gimp_clone_tool_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display)
{
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
GimpCloneOptions *options;
options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options);
if (options->clone_type == GIMP_IMAGE_CLONE && key == GDK_CONTROL_MASK)
{
if (press)
paint_tool->status = _("Click to set the clone source.");
else
paint_tool->status = _("Click to clone.");
}
GIMP_TOOL_CLASS (parent_class)->modifier_key (tool, key, press, state,
display);
}
static void
gimp_clone_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
......@@ -316,8 +351,18 @@ gimp_clone_tool_oper_update (GimpTool *tool,
if (clone->src_drawable == NULL)
{
gimp_tool_replace_status (tool, display,
_("Ctrl-Click to set a clone source."));
if (state & GDK_CONTROL_MASK)
gimp_tool_replace_status (tool, display,
_("Click to set the clone source."));
else
{
gchar *status;
status = g_strdup_printf (_("%s%sClick to set a clone source."),
gimp_get_mod_name_control (),
gimp_get_mod_separator ());
gimp_tool_replace_status (tool, display, status);
g_free (status);
}
}
else
{
......
......@@ -38,17 +38,24 @@
#include "gimp-intl.h"
static void gimp_convolve_tool_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display);
static void gimp_convolve_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display);
static GtkWidget * gimp_convolve_options_gui (GimpToolOptions *options);
static void gimp_convolve_tool_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display);
static void gimp_convolve_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display);
static void gimp_convolve_tool_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display);
static void gimp_convolve_tool_status_update (GimpTool *tool,
GimpConvolveType type);
static GtkWidget * gimp_convolve_options_gui (GimpToolOptions *options);
G_DEFINE_TYPE (GimpConvolveTool, gimp_convolve_tool, GIMP_TYPE_PAINT_TOOL)
......@@ -80,6 +87,7 @@ gimp_convolve_tool_class_init (GimpConvolveToolClass *klass)
tool_class->modifier_key = gimp_convolve_tool_modifier_key;
tool_class->cursor_update = gimp_convolve_tool_cursor_update;
tool_class->oper_update = gimp_convolve_tool_oper_update;
}
static void
......@@ -91,6 +99,8 @@ gimp_convolve_tool_init (GimpConvolveTool *convolve)
GIMP_TOOL_CURSOR_BLUR);
gimp_tool_control_set_toggle_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_MINUS);
gimp_convolve_tool_status_update (tool, GIMP_BLUR_CONVOLVE);
}
static void
......@@ -139,6 +149,46 @@ gimp_convolve_tool_cursor_update (GimpTool *tool,
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
}
static void
gimp_convolve_tool_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display)
{
GimpConvolveOptions *options;
options = GIMP_CONVOLVE_OPTIONS (tool->tool_info->tool_options);
gimp_convolve_tool_status_update (tool, options->type);
GIMP_TOOL_CLASS (parent_class)->oper_update (tool, coords, state, proximity,
display);
}
static void
gimp_convolve_tool_status_update (GimpTool *tool,
GimpConvolveType type)
{
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
switch (type)
{
case GIMP_BLUR_CONVOLVE:
paint_tool->status = _("Click to blur.");
paint_tool->status_line = _("Click to blur the line.");
paint_tool->status_ctrl = _("%s to sharpen");
break;
case GIMP_SHARPEN_CONVOLVE:
paint_tool->status = _("Click to sharpen.");
paint_tool->status_line = _("Click to sharpen the line.");
paint_tool->status_ctrl = _("%s to blur");
break;
default:
break;
}
}
/* tool options stuff */
......
......@@ -38,17 +38,24 @@
#include "gimp-intl.h"
static void gimp_dodge_burn_tool_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display);
static void gimp_dodge_burn_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display);
static GtkWidget * gimp_dodge_burn_options_gui (GimpToolOptions *tool_options);
static void gimp_dodge_burn_tool_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display);
static void gimp_dodge_burn_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display);
static void gimp_dodge_burn_tool_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display);
static void gimp_dodge_burn_tool_status_update (GimpTool *tool,
GimpDodgeBurnType type);
static GtkWidget * gimp_dodge_burn_options_gui (GimpToolOptions *tool_options);
G_DEFINE_TYPE (GimpDodgeBurnTool, gimp_dodge_burn_tool, GIMP_TYPE_PAINT_TOOL)
......@@ -80,6 +87,7 @@ gimp_dodge_burn_tool_class_init (GimpDodgeBurnToolClass *klass)
tool_class->modifier_key = gimp_dodge_burn_tool_modifier_key;
tool_class->cursor_update = gimp_dodge_burn_tool_cursor_update;
tool_class->oper_update = gimp_dodge_burn_tool_oper_update;
}
static void
......@@ -91,6 +99,8 @@ gimp_dodge_burn_tool_init (GimpDodgeBurnTool *dodgeburn)
GIMP_TOOL_CURSOR_DODGE);
gimp_tool_control_set_toggle_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_BURN);
gimp_dodge_burn_tool_status_update (tool, GIMP_BURN);
}
static void
......@@ -140,6 +150,47 @@ gimp_dodge_burn_tool_cursor_update (GimpTool *tool,
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
}
static void
gimp_dodge_burn_tool_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display)
{
GimpDodgeBurnOptions *options;
options = GIMP_DODGE_BURN_OPTIONS (tool->tool_info->tool_options);
gimp_dodge_burn_tool_status_update (tool, options->type);
GIMP_TOOL_CLASS (parent_class)->oper_update (tool, coords, state, proximity,
display);
}
static void
gimp_dodge_burn_tool_status_update (GimpTool *tool,
GimpDodgeBurnType type)
{
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
switch (type)
{
case GIMP_DODGE:
paint_tool->status = _("Click to dodge.");
paint_tool->status_line = _("Click to dodge the line.");
paint_tool->status_ctrl = _("%s to burn");
break;
case GIMP_BURN:
paint_tool->status = _("Click to burn.");
paint_tool->status_line = _("Click to burn the line.");
paint_tool->status_ctrl = _("%s to dodge");
break;
default:
break;
}
}
/* tool options stuff */
......
......@@ -85,15 +85,20 @@ gimp_eraser_tool_class_init (GimpEraserToolClass *klass)
static void
gimp_eraser_tool_init (GimpEraserTool *eraser)
{
GimpTool *tool = GIMP_TOOL (eraser);
GimpTool *tool = GIMP_TOOL (eraser);
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (eraser);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_ERASER);
gimp_tool_control_set_toggle_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_MINUS);
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (eraser),
gimp_paint_tool_enable_color_picker (paint_tool,
GIMP_COLOR_PICK_MODE_BACKGROUND);
paint_tool->status = _("Click to erase.");
paint_tool->status_line = _("Click to erase the line.");
paint_tool->status_ctrl = _("%s to pick a background color");
}
static void
......
......@@ -44,6 +44,7 @@
#include "paint/gimppaintoptions.h"
#include "widgets/gimpdevices.h"
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
......@@ -162,6 +163,10 @@ gimp_paint_tool_init (GimpPaintTool *paint_tool)
paint_tool->pick_colors = FALSE;
paint_tool->draw_line = FALSE;
paint_tool->status = _("Click to paint.");
paint_tool->status_line = _("Click to draw the line.");
paint_tool->status_ctrl = _("%s to pick a color");
paint_tool->show_cursor = TRUE;
paint_tool->draw_brush = TRUE;
paint_tool->brush_x = 0.0;
......@@ -542,9 +547,23 @@ gimp_paint_tool_modifier_key (GimpTool *tool,
gimp_color_tool_enable (GIMP_COLOR_TOOL (tool),
GIMP_COLOR_OPTIONS (info->tool_options));
gimp_tool_push_status (tool, display,
_("Click in any image to pick the "
"foreground color."));
switch (GIMP_COLOR_TOOL (tool)->pick_mode)
{
case GIMP_COLOR_PICK_MODE_FOREGROUND:
gimp_tool_push_status (tool, display,
_("Click in any image to pick the "
"foreground color."));
break;
case GIMP_COLOR_PICK_MODE_BACKGROUND:
gimp_tool_push_status (tool, display,
_("Click in any image to pick the "
"background color."));
break;
default:
break;
}
}
}
else
......@@ -615,7 +634,7 @@ gimp_paint_tool_oper_update (GimpTool *tool,
gdouble dx, dy, dist;
gchar status_str[STATUSBAR_SIZE];
const gchar *status_help;
gchar *status_help;
gint off_x, off_y;
gboolean hard;
......@@ -633,11 +652,11 @@ gimp_paint_tool_oper_update (GimpTool *tool,
dx = core->cur_coords.x - core->last_coords.x;
dy = core->cur_coords.y - core->last_coords.y;
if ((state & GDK_CONTROL_MASK))
status_help = _("Click to draw the line.");
else
status_help = _("Click to draw the line."
" (try Ctrl for constrained angles)");
status_help = gimp_suggest_modifiers (paint_tool->status_line,
GDK_CONTROL_MASK & ~state,
NULL,
_("%s for constrained angles"),
NULL);
/* show distance in statusbar */
if (shell->unit == GIMP_UNIT_PIXEL)
......@@ -663,22 +682,30 @@ gimp_paint_tool_oper_update (GimpTool *tool,
g_snprintf (status_str, sizeof (status_str), format_str, dist,
status_help);
}
g_free (status_help);
gimp_tool_push_status (tool, display, status_str);
paint_tool->draw_line = TRUE;
}
else
{
gchar *status;
if (display == tool->display)
gimp_tool_push_status (tool, display,
_("Click to paint. (try "
"Shift for a straight line, "
"Ctrl to pick a color)"));
status = gimp_suggest_modifiers (paint_tool->status,
(GDK_SHIFT_MASK
| GDK_CONTROL_MASK) & ~state,
_("%s for a straight line"),
paint_tool->status_ctrl,
NULL);
else
gimp_tool_push_status (tool, display,
_("Click to paint. (try "
"Ctrl to pick a color)"));
status = gimp_suggest_modifiers (paint_tool->status,
GDK_CONTROL_MASK & ~state,
NULL,
paint_tool->status_ctrl,
NULL);
gimp_tool_push_status (tool, display, status);
g_free (status);
paint_tool->draw_line = FALSE;
}
......
......@@ -45,6 +45,10 @@ struct _GimpPaintTool
gdouble brush_x;
gdouble brush_y;
const gchar *status; /* status message */
const gchar *status_line; /* status message when drawing a line */
const gchar *status_ctrl; /* additional message for the ctrl modifier */
GimpPaintCore *core;
};
......
......@@ -29,6 +29,7 @@
#include "paint/gimpsmudgeoptions.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpwidgets-utils.h"
#include "gimpsmudgetool.h"
#include "gimppaintoptions-gui.h"
......@@ -68,12 +69,16 @@ gimp_smudge_tool_class_init (GimpSmudgeToolClass *klass)
static void
gimp_smudge_tool_init (GimpSmudgeTool *smudge)
{
GimpTool *tool = GIMP_TOOL (smudge);
GimpTool *tool = GIMP_TOOL (smudge);
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (smudge);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_SMUDGE);
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (smudge),
GIMP_COLOR_PICK_MODE_FOREGROUND);
paint_tool->status = _("Click to smudge.");
paint_tool->status_line = _("Click to smudge the line.");
}
......
......@@ -70,6 +70,11 @@ static void gimp_clone_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display);
static void gimp_clone_tool_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display);
static void gimp_clone_tool_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
......@@ -115,8 +120,9 @@ gimp_clone_tool_class_init (GimpCloneToolClass *klass)
tool_class->control = gimp_clone_tool_control;
tool_class->button_press = gimp_clone_tool_button_press;
tool_class->motion = gimp_clone_tool_motion;
tool_class->cursor_update = gimp_clone_tool_cursor_update;
tool_class->modifier_key = gimp_clone_tool_modifier_key;
tool_class->oper_update = gimp_clone_tool_oper_update;
tool_class->cursor_update = gimp_clone_tool_cursor_update;
draw_tool_class->draw = gimp_clone_tool_draw;
}
......@@ -124,12 +130,16 @@ gimp_clone_tool_class_init (GimpCloneToolClass *klass)
static void
gimp_clone_tool_init (GimpCloneTool *clone)
{
GimpTool *tool = GIMP_TOOL (clone);
GimpTool *tool = GIMP_TOOL (clone);
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_CLONE);
gimp_tool_control_set_action_object_2 (tool->control,
"context/context-pattern-select-set");
paint_tool->status = _("Click to clone.");
paint_tool->status_ctrl = _("%s to set a new clone source");
}
static gboolean
......@@ -259,6 +269,31 @@ gimp_clone_tool_motion (GimpTool *tool,
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
}
static void
gimp_clone_tool_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display)
{
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
GimpCloneOptions *options;
options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options);
if (options->clone_type == GIMP_IMAGE_CLONE && key == GDK_CONTROL_MASK)
{
if (press)
paint_tool->status = _("Click to set the clone source.");
else
paint_tool->status = _("Click to clone.");
}
GIMP_TOOL_CLASS (parent_class)->modifier_key (tool, key, press, state,
display);
}
static void
gimp_clone_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
......@@ -316,8 +351,18 @@ gimp_clone_tool_oper_update (GimpTool *tool,
if (clone->src_drawable == NULL)
{
gimp_tool_replace_status (tool, display,
_("Ctrl-Click to set a clone source."));
if (state & GDK_CONTROL_MASK)
gimp_tool_replace_status (tool, display,
_("Click to set the clone source."));
else
{
gchar *status;
status = g_strdup_printf (_("%s%sClick to set a clone source."),
gimp_get_mod_name_control (),
gimp_get_mod_separator ());
gimp_tool_replace_status (tool, display, status);
g_free (status);
}
}
else
{
......
......@@ -45,6 +45,7 @@
#include "vectors/gimpbezierstroke.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
......@@ -101,6 +102,7 @@ static void gimp_vector_tool_oper_update (GimpTool *tool,
GimpDisplay *display);
static void gimp_vector_tool_status_update (GimpTool *tool,
GimpDisplay *display,
GdkModifierType state,
gboolean proximity);
static void gimp_vector_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
......@@ -1125,14 +1127,15 @@ gimp_vector_tool_oper_update (GimpTool *tool,
break;
}
gimp_vector_tool_status_update (tool, display, proximity);
gimp_vector_tool_status_update (tool, display, state, proximity);
}
static void
gimp_vector_tool_status_update (GimpTool *tool,
GimpDisplay *display,
gboolean proximity)
gimp_vector_tool_status_update (GimpTool *tool,
GimpDisplay *display,
GdkModifierType state,
gboolean proximity)
{
GimpVectorTool *vector_tool = GIMP_VECTOR_TOOL (tool);
......@@ -1140,7 +1143,7 @@ gimp_vector_tool_status_update (GimpTool *tool,
if (proximity)
{