summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-04-20 20:18:15 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-04-20 20:18:15 +0000
commit543eeb1fcf74b65e9de37f0586fa78a4e64ed449 (patch)
tree73b71f7fe4f46d7b76b0cdac72ae58fc12918935 /src
parentSVG 1.1 Conditional Processing Module rendering support (<switch> element, re... (diff)
downloadinkscape-543eeb1fcf74b65e9de37f0586fa78a4e64ed449.tar.gz
inkscape-543eeb1fcf74b65e9de37f0586fa78a4e64ed449.zip
fix statusbar when cancelling drawing
(bzr r557)
Diffstat (limited to 'src')
-rw-r--r--src/pen-context.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/pen-context.cpp b/src/pen-context.cpp
index 0eec95cd6..bf0b1f511 100644
--- a/src/pen-context.cpp
+++ b/src/pen-context.cpp
@@ -743,6 +743,19 @@ pen_lastpoint_move_screen (SPPenContext *const pc, gdouble x, gdouble y)
pen_lastpoint_move (pc, x / pc->desktop->current_zoom(), y / pc->desktop->current_zoom());
}
+static void
+pen_cancel (SPPenContext *const pc)
+{
+ pc->state = SP_PEN_CONTEXT_STOP;
+ spdc_reset_colors(pc);
+ sp_canvas_item_hide(pc->c0);
+ sp_canvas_item_hide(pc->c1);
+ sp_canvas_item_hide(pc->cl0);
+ sp_canvas_item_hide(pc->cl1);
+ pc->_message_context->clear();
+ pc->_message_context->flash(Inkscape::NORMAL_MESSAGE, _("Drawing cancelled"));
+}
+
static gint
pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
{
@@ -822,12 +835,7 @@ pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
case GDK_Escape:
if (pc->npoints != 0) {
// if drawing, cancel, otherwise pass it up for deselecting
- pc->state = SP_PEN_CONTEXT_STOP;
- spdc_reset_colors(pc);
- sp_canvas_item_hide(pc->c0);
- sp_canvas_item_hide(pc->c1);
- sp_canvas_item_hide(pc->cl0);
- sp_canvas_item_hide(pc->cl1);
+ pen_cancel (pc);
ret = TRUE;
}
break;
@@ -835,12 +843,7 @@ pen_handle_key_press(SPPenContext *const pc, GdkEvent *event)
case GDK_Z:
if (MOD__CTRL_ONLY && pc->npoints != 0) {
// if drawing, cancel, otherwise pass it up for undo
- pc->state = SP_PEN_CONTEXT_STOP;
- spdc_reset_colors(pc);
- sp_canvas_item_hide(pc->c0);
- sp_canvas_item_hide(pc->c1);
- sp_canvas_item_hide(pc->cl0);
- sp_canvas_item_hide(pc->cl1);
+ pen_cancel (pc);
ret = TRUE;
}
break;
@@ -1051,7 +1054,7 @@ spdc_pen_finish(SPPenContext *const pc, gboolean const closed)
{
SPDesktop *const desktop = pc->desktop;
pc->_message_context->clear();
- desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Finishing pen"));
+ desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Drawing finished"));
sp_curve_reset(pc->red_curve);
spdc_concat_colors_and_flush(pc, closed);