Allow some paint tools to not suggest using the Ctrl modifier.
2006-08-02 Raphael Quinet <raphael@gimp.org> * app/tools/gimppainttool.c (gimp_paint_tool_oper_update): Allow some paint tools to not suggest using the Ctrl modifier. * app/tools/gimpvectortool.c (gimp_vector_tool_status_update): slightly more elegant way to free the status string.
This commit is contained in:

committed by
Raphaël Quinet

parent
b1c35145a2
commit
8960d6ac5a
@ -1,3 +1,11 @@
|
||||
2006-08-02 Raphaël Quinet <raphael@gimp.org>
|
||||
|
||||
* app/tools/gimppainttool.c (gimp_paint_tool_oper_update): Allow
|
||||
some paint tools to not suggest using the Ctrl modifier.
|
||||
|
||||
* app/tools/gimpvectortool.c (gimp_vector_tool_status_update):
|
||||
slightly more elegant way to free the status string.
|
||||
|
||||
2006-08-02 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* plug-ins/common/pat.c: enable "activates-default" on the name
|
||||
|
@ -689,21 +689,24 @@ gimp_paint_tool_oper_update (GimpTool *tool,
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *status;
|
||||
gchar *status;
|
||||
GdkModifierType modifiers = 0;
|
||||
|
||||
/* HACK: A paint tool may set status_ctrl to NULL to indicate that
|
||||
* it ignores the Ctrl modifier (temporarily or permanently), so
|
||||
* it should not be suggested. This is different from how
|
||||
* gimp_suggest_modifiers() would interpret this parameter. */
|
||||
if (paint_tool->status_ctrl != NULL)
|
||||
modifiers |= GDK_CONTROL_MASK;
|
||||
/* suggest drawing lines only after the first point is set */
|
||||
if (display == tool->display)
|
||||
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
|
||||
status = gimp_suggest_modifiers (paint_tool->status,
|
||||
GDK_CONTROL_MASK & ~state,
|
||||
NULL,
|
||||
paint_tool->status_ctrl,
|
||||
NULL);
|
||||
modifiers |= GDK_SHIFT_MASK;
|
||||
|
||||
status = gimp_suggest_modifiers (paint_tool->status,
|
||||
modifiers & ~state,
|
||||
_("%s for a straight line"),
|
||||
paint_tool->status_ctrl,
|
||||
NULL);
|
||||
gimp_tool_push_status (tool, display, status);
|
||||
g_free (status);
|
||||
|
||||
|
@ -689,21 +689,24 @@ gimp_paint_tool_oper_update (GimpTool *tool,
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *status;
|
||||
gchar *status;
|
||||
GdkModifierType modifiers = 0;
|
||||
|
||||
/* HACK: A paint tool may set status_ctrl to NULL to indicate that
|
||||
* it ignores the Ctrl modifier (temporarily or permanently), so
|
||||
* it should not be suggested. This is different from how
|
||||
* gimp_suggest_modifiers() would interpret this parameter. */
|
||||
if (paint_tool->status_ctrl != NULL)
|
||||
modifiers |= GDK_CONTROL_MASK;
|
||||
/* suggest drawing lines only after the first point is set */
|
||||
if (display == tool->display)
|
||||
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
|
||||
status = gimp_suggest_modifiers (paint_tool->status,
|
||||
GDK_CONTROL_MASK & ~state,
|
||||
NULL,
|
||||
paint_tool->status_ctrl,
|
||||
NULL);
|
||||
modifiers |= GDK_SHIFT_MASK;
|
||||
|
||||
status = gimp_suggest_modifiers (paint_tool->status,
|
||||
modifiers & ~state,
|
||||
_("%s for a straight line"),
|
||||
paint_tool->status_ctrl,
|
||||
NULL);
|
||||
gimp_tool_push_status (tool, display, status);
|
||||
g_free (status);
|
||||
|
||||
|
@ -1143,7 +1143,8 @@ gimp_vector_tool_status_update (GimpTool *tool,
|
||||
|
||||
if (proximity)
|
||||
{
|
||||
gchar *status = NULL;
|
||||
gchar *status = NULL;
|
||||
gboolean free_status = FALSE;
|
||||
|
||||
switch (vector_tool->function)
|
||||
{
|
||||
@ -1160,6 +1161,7 @@ gimp_vector_tool_status_update (GimpTool *tool,
|
||||
status = gimp_suggest_modifiers (_("Click to create a new anchor."),
|
||||
GDK_SHIFT_MASK & ~state,
|
||||
NULL, NULL, NULL);
|
||||
free_status = TRUE;
|
||||
break;
|
||||
case VECTORS_MOVE_ANCHOR:
|
||||
status = _("Click-Drag to move the anchor around.");
|
||||
@ -1172,6 +1174,7 @@ gimp_vector_tool_status_update (GimpTool *tool,
|
||||
"around."),
|
||||
GDK_SHIFT_MASK & ~state,
|
||||
NULL, NULL, NULL);
|
||||
free_status = TRUE;
|
||||
break;
|
||||
case VECTORS_MOVE_CURVE:
|
||||
if (GIMP_VECTOR_OPTIONS (tool->tool_info->tool_options)->polygonal)
|
||||
@ -1184,12 +1187,14 @@ gimp_vector_tool_status_update (GimpTool *tool,
|
||||
"shape of the curve."),
|
||||
GDK_SHIFT_MASK & ~state,
|
||||
_("%s: symmetrical"), NULL, NULL);
|
||||
free_status = TRUE;
|
||||
break;
|
||||
case VECTORS_MOVE_STROKE:
|
||||
status = gimp_suggest_modifiers (_("Click-Drag to move the "
|
||||
"component around."),
|
||||
GDK_SHIFT_MASK & ~state,
|
||||
NULL, NULL, NULL);
|
||||
free_status = TRUE;
|
||||
break;
|
||||
case VECTORS_MOVE_VECTORS:
|
||||
status = _("Click-Drag to move the path around.");
|
||||
@ -1199,6 +1204,7 @@ gimp_vector_tool_status_update (GimpTool *tool,
|
||||
"on the path."),
|
||||
GDK_SHIFT_MASK & ~state,
|
||||
NULL, NULL, NULL);
|
||||
free_status = TRUE;
|
||||
break;
|
||||
case VECTORS_DELETE_ANCHOR:
|
||||
status = _("Click to delete this anchor.");
|
||||
@ -1221,19 +1227,8 @@ gimp_vector_tool_status_update (GimpTool *tool,
|
||||
if (status)
|
||||
gimp_tool_push_status (tool, display, status);
|
||||
|
||||
/* not very elegant */
|
||||
switch (vector_tool->function)
|
||||
{
|
||||
case VECTORS_ADD_ANCHOR:
|
||||
case VECTORS_MOVE_HANDLE:
|
||||
case VECTORS_MOVE_CURVE:
|
||||
case VECTORS_MOVE_STROKE:
|
||||
case VECTORS_INSERT_ANCHOR:
|
||||
g_free (status);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (free_status)
|
||||
g_free (status);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user