app/tools/gimppainttool.c app/tools/gimpvectortool.c Update the status bar

2006-07-30  Raphael Quinet  <raphael@gimp.org>

	* app/tools/gimppainttool.c
	* app/tools/gimpvectortool.c
	* app/tools/gimpselectiontool.c: Update the status bar messages.
	Work in progress, partial fix for bug #124040.
This commit is contained in:
Raphael Quinet 2006-07-30 20:15:07 +00:00 committed by Raphaël Quinet
parent 1811714791
commit 3739ee1883
5 changed files with 112 additions and 46 deletions

View file

@ -1,3 +1,10 @@
2006-07-30 Raphaël Quinet <raphael@gimp.org>
* app/tools/gimppainttool.c
* app/tools/gimpvectortool.c
* app/tools/gimpselectiontool.c: Update the status bar messages.
Work in progress, partial fix for bug #124040.
2006-07-30 Karine Delvare <edhel@gimp.org>
* app/tools/gimprectangletool.c: check zero division in the right

View file

@ -58,7 +58,7 @@
#define TARGET_SIZE 15
#define STATUSBAR_SIZE 128
#define STATUSBAR_SIZE 200
static GObject * gimp_paint_tool_constructor (GType type,
@ -542,12 +542,18 @@ 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."));
}
}
else
{
if (gimp_color_tool_is_enabled (GIMP_COLOR_TOOL (tool)))
gimp_color_tool_disable (GIMP_COLOR_TOOL (tool));
{
gimp_tool_pop_status (tool, display);
gimp_color_tool_disable (GIMP_COLOR_TOOL (tool));
}
}
}
}
@ -607,10 +613,11 @@ gimp_paint_tool_oper_update (GimpTool *tool,
* draw a line.
*/
gdouble dx, dy, dist;
gchar status_str[STATUSBAR_SIZE];
gint off_x, off_y;
gboolean hard;
gdouble dx, dy, dist;
gchar status_str[STATUSBAR_SIZE];
const gchar *status_help;
gint off_x, off_y;
gboolean hard;
core->cur_coords = *coords;
@ -626,20 +633,26 @@ 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)");
/* show distance in statusbar */
if (shell->unit == GIMP_UNIT_PIXEL)
{
dist = sqrt (SQR (dx) + SQR (dy));
g_snprintf (status_str, sizeof (status_str), "%.1f %s",
dist, _("pixels"));
g_snprintf (status_str, sizeof (status_str), "%.1f %s. %s",
dist, _("pixels"), status_help);
}
else
{
GimpImage *image = display->image;
gchar format_str[64];
g_snprintf (format_str, sizeof (format_str), "%%.%df %s",
g_snprintf (format_str, sizeof (format_str), "%%.%df %s. %%s",
_gimp_unit_get_digits (image->gimp, shell->unit),
_gimp_unit_get_symbol (image->gimp, shell->unit));
@ -647,7 +660,8 @@ gimp_paint_tool_oper_update (GimpTool *tool,
sqrt (SQR (dx / image->xresolution) +
SQR (dy / image->yresolution)));
g_snprintf (status_str, sizeof (status_str), format_str, dist);
g_snprintf (status_str, sizeof (status_str), format_str, dist,
status_help);
}
gimp_tool_push_status (tool, display, status_str);
@ -658,7 +672,13 @@ gimp_paint_tool_oper_update (GimpTool *tool,
{
if (display == tool->display)
gimp_tool_push_status (tool, display,
_("Press Shift to draw a straight line."));
_("Click to paint. (try "
"Shift for a straight line, "
"Ctrl to pick a color)"));
else
gimp_tool_push_status (tool, display,
_("Click to paint. (try "
"Ctrl to pick a color)"));
paint_tool->draw_line = FALSE;
}

View file

@ -58,7 +58,7 @@
#define TARGET_SIZE 15
#define STATUSBAR_SIZE 128
#define STATUSBAR_SIZE 200
static GObject * gimp_paint_tool_constructor (GType type,
@ -542,12 +542,18 @@ 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."));
}
}
else
{
if (gimp_color_tool_is_enabled (GIMP_COLOR_TOOL (tool)))
gimp_color_tool_disable (GIMP_COLOR_TOOL (tool));
{
gimp_tool_pop_status (tool, display);
gimp_color_tool_disable (GIMP_COLOR_TOOL (tool));
}
}
}
}
@ -607,10 +613,11 @@ gimp_paint_tool_oper_update (GimpTool *tool,
* draw a line.
*/
gdouble dx, dy, dist;
gchar status_str[STATUSBAR_SIZE];
gint off_x, off_y;
gboolean hard;
gdouble dx, dy, dist;
gchar status_str[STATUSBAR_SIZE];
const gchar *status_help;
gint off_x, off_y;
gboolean hard;
core->cur_coords = *coords;
@ -626,20 +633,26 @@ 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)");
/* show distance in statusbar */
if (shell->unit == GIMP_UNIT_PIXEL)
{
dist = sqrt (SQR (dx) + SQR (dy));
g_snprintf (status_str, sizeof (status_str), "%.1f %s",
dist, _("pixels"));
g_snprintf (status_str, sizeof (status_str), "%.1f %s. %s",
dist, _("pixels"), status_help);
}
else
{
GimpImage *image = display->image;
gchar format_str[64];
g_snprintf (format_str, sizeof (format_str), "%%.%df %s",
g_snprintf (format_str, sizeof (format_str), "%%.%df %s. %%s",
_gimp_unit_get_digits (image->gimp, shell->unit),
_gimp_unit_get_symbol (image->gimp, shell->unit));
@ -647,7 +660,8 @@ gimp_paint_tool_oper_update (GimpTool *tool,
sqrt (SQR (dx / image->xresolution) +
SQR (dy / image->yresolution)));
g_snprintf (status_str, sizeof (status_str), format_str, dist);
g_snprintf (status_str, sizeof (status_str), format_str, dist,
status_help);
}
gimp_tool_push_status (tool, display, status_str);
@ -658,7 +672,13 @@ gimp_paint_tool_oper_update (GimpTool *tool,
{
if (display == tool->display)
gimp_tool_push_status (tool, display,
_("Press Shift to draw a straight line."));
_("Click to paint. (try "
"Shift for a straight line, "
"Ctrl to pick a color)"));
else
gimp_tool_push_status (tool, display,
_("Click to paint. (try "
"Ctrl to pick a color)"));
paint_tool->draw_line = FALSE;
}

View file

@ -244,30 +244,49 @@ gimp_selection_tool_oper_update (GimpTool *tool,
{
const gchar *status = NULL;
if (! gimp_enum_get_value (GIMP_TYPE_CHANNEL_OPS, selection_tool->op,
NULL, NULL, &status, NULL))
switch (selection_tool->op)
{
switch (selection_tool->op)
{
case SELECTION_MOVE_MASK:
status = _("Move the selection mask");
break;
case SELECTION_REPLACE:
if (! gimp_channel_is_empty (selection))
status = N_("Click-Drag to replace the current selection. "
"(try Shift, Ctrl, Alt)");
else
status = N_("Click-Drag to create a new selection.");
break;
case SELECTION_MOVE:
status = _("Move the selected pixels");
break;
case SELECTION_ADD:
status = N_("Click-Drag to add to the current selection. "
"(try Ctrl)");
break;
case SELECTION_MOVE_COPY:
status = _("Move a copy of the selected pixels");
break;
case SELECTION_SUBTRACT:
status = N_("Click-Drag to subtract from the current selection. "
"(try Shift)");
break;
case SELECTION_ANCHOR:
status = _("Anchor the floating selection");
break;
case SELECTION_INTERSECT:
status = N_("Click-Drag to intersect with the current selection.");
break;
default:
g_return_if_reached ();
}
case SELECTION_MOVE_MASK:
status = _("Click-Drag to move the selection mask. "
"(try Shift or Ctrl)");
break;
case SELECTION_MOVE:
status = _("Click-Drag to move the selected pixels.");
break;
case SELECTION_MOVE_COPY:
status = _("Click-Drag to move a copy of the selected pixels.");
break;
case SELECTION_ANCHOR:
status = _("Click to anchor the floating selection.");
break;
default:
g_return_if_reached ();
}
if (status)

View file

@ -1154,7 +1154,7 @@ gimp_vector_tool_status_update (GimpTool *tool,
status = _("Click to create a new component of the path.");
break;
case VECTORS_ADD_ANCHOR:
status = _("Click to create a new anchor. (try SHIFT)");
status = _("Click to create a new anchor. (try Shift)");
break;
case VECTORS_MOVE_ANCHOR:
status = _("Click-Drag to move the anchor around.");
@ -1163,24 +1163,24 @@ gimp_vector_tool_status_update (GimpTool *tool,
status = _("Click-Drag to move the anchors around.");
break;
case VECTORS_MOVE_HANDLE:
status = _("Click-Drag to move the handle around. (try SHIFT)");
status = _("Click-Drag to move the handle around. (try Shift)");
break;
case VECTORS_MOVE_CURVE:
if (GIMP_VECTOR_OPTIONS (tool->tool_info->tool_options)->polygonal)
status = _("Click-Drag to move the anchors around.");
else
status = _("Click-Drag to change the shape of the curve. "
"(SHIFT: symmetrical)");
"(Shift: symmetrical)");
break;
case VECTORS_MOVE_STROKE:
status = _("Click-Drag to move the component around. "
"(try SHIFT)");
"(try Shift)");
break;
case VECTORS_MOVE_VECTORS:
status = _("Click-Drag to move the path around.");
break;
case VECTORS_INSERT_ANCHOR:
status = _("Click to insert an anchor on the path. (try SHIFT)");
status = _("Click to insert an anchor on the path. (try Shift)");
break;
case VECTORS_DELETE_ANCHOR:
status = _("Click to delete this anchor.");