use gimp_suggest_modifiers().

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

	* app/tools/gimpselectiontool.c (gimp_selection_tool_oper_update):
	use gimp_suggest_modifiers().

	* app/tools/gimpclonetool.c (gimp_clone_tool_oper_update): suggest
	ctrl only when cloning from the image, not from a pattern

	* app/tools/gimpsmudgetool.c (gimp_smudge_tool_init): don't
	suggest Ctrl for that tool, even if it can be used.
This commit is contained in:
Raphael Quinet
2006-08-03 09:06:36 +00:00
committed by Raphaël Quinet
parent 8960d6ac5a
commit d2adebbc18
5 changed files with 71 additions and 10 deletions

View File

@ -1,3 +1,14 @@
2006-08-03 Raphaël Quinet <raphael@gimp.org>
* app/tools/gimpselectiontool.c (gimp_selection_tool_oper_update):
use gimp_suggest_modifiers().
* app/tools/gimpclonetool.c (gimp_clone_tool_oper_update): suggest
ctrl only when cloning from the image, not from a pattern
* app/tools/gimpsmudgetool.c (gimp_smudge_tool_init): don't
suggest Ctrl for that tool, even if it can be used.
2006-08-02 Raphaël Quinet <raphael@gimp.org>
* app/tools/gimppainttool.c (gimp_paint_tool_oper_update): Allow

View File

@ -342,6 +342,16 @@ gimp_clone_tool_oper_update (GimpTool *tool,
options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options);
if (proximity)
{
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
if (options->clone_type == GIMP_IMAGE_CLONE)
paint_tool->status_ctrl = _("%s to set a new clone source");
else
paint_tool->status_ctrl = NULL;
}
GIMP_TOOL_CLASS (parent_class)->oper_update (tool, coords, state, proximity,
display);

View File

@ -33,6 +33,8 @@
#include "display/gimpdisplay.h"
#include "widgets/gimpwidgets-utils.h"
#include "gimpeditselectiontool.h"
#include "gimpselectiontool.h"
#include "gimpselectionoptions.h"
@ -242,35 +244,59 @@ gimp_selection_tool_oper_update (GimpTool *tool,
if (proximity)
{
const gchar *status = NULL;
gchar *status = NULL;
gboolean free_status = FALSE;
GdkModifierType modifiers = (GDK_SHIFT_MASK | GDK_CONTROL_MASK);
if (! gimp_channel_is_empty (selection))
modifiers |= GDK_MOD1_MASK;
switch (selection_tool->op)
{
case SELECTION_REPLACE:
if (! gimp_channel_is_empty (selection))
status = N_("Click-Drag to replace the current selection. "
"(try Shift, Ctrl, Alt)");
{
status = gimp_suggest_modifiers (_("Click-Drag to replace the "
"current selection."),
modifiers & ~state,
NULL, NULL, NULL);
free_status = TRUE;
}
else
status = N_("Click-Drag to create a new selection.");
break;
case SELECTION_ADD:
status = N_("Click-Drag to add to the current selection. "
"(try Ctrl)");
status = gimp_suggest_modifiers (_("Click-Drag to add to the "
"current selection."),
modifiers
& ~(state | GDK_SHIFT_MASK),
NULL, NULL, NULL);
free_status = TRUE;
break;
case SELECTION_SUBTRACT:
status = N_("Click-Drag to subtract from the current selection. "
"(try Shift)");
status = gimp_suggest_modifiers (_("Click-Drag to subtract from the "
"current selection."),
modifiers
& ~(state | GDK_CONTROL_MASK),
NULL, NULL, NULL);
free_status = TRUE;
break;
case SELECTION_INTERSECT:
status = N_("Click-Drag to intersect with the current selection.");
status = gimp_suggest_modifiers (_("Click-Drag to intersect with "
"the current selection."),
modifiers & ~state,
NULL, NULL, NULL);
free_status = TRUE;
break;
case SELECTION_MOVE_MASK:
status = _("Click-Drag to move the selection mask. "
"(try Shift or Ctrl)");
status = gimp_suggest_modifiers (_("Click-Drag to move the "
"selection mask."),
modifiers & ~state,
NULL, NULL, NULL);
free_status = TRUE;
break;
case SELECTION_MOVE:
@ -291,6 +317,9 @@ gimp_selection_tool_oper_update (GimpTool *tool,
if (status)
gimp_tool_push_status (tool, display, status);
if (free_status)
g_free (status);
}
}

View File

@ -79,6 +79,7 @@ gimp_smudge_tool_init (GimpSmudgeTool *smudge)
paint_tool->status = _("Click to smudge.");
paint_tool->status_line = _("Click to smudge the line.");
paint_tool->status_ctrl = NULL; /* don't suggest Ctrl even if it works */
}

View File

@ -342,6 +342,16 @@ gimp_clone_tool_oper_update (GimpTool *tool,
options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options);
if (proximity)
{
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
if (options->clone_type == GIMP_IMAGE_CLONE)
paint_tool->status_ctrl = _("%s to set a new clone source");
else
paint_tool->status_ctrl = NULL;
}
GIMP_TOOL_CLASS (parent_class)->oper_update (tool, coords, state, proximity,
display);