summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2007-08-21 01:37:25 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2007-08-21 01:37:25 +0000
commit3a42bb51dbbe50879f8a4470851284f2b1d988ef (patch)
treee58cb1ac32af837f5fa3745adee553baa5da0882 /src
parentadd colon before value description (diff)
downloadinkscape-3a42bb51dbbe50879f8a4470851284f2b1d988ef.tar.gz
inkscape-3a42bb51dbbe50879f8a4470851284f2b1d988ef.zip
gobble more of motion events; make statusbar messages immediate for better visual feedback
(bzr r3561)
Diffstat (limited to 'src')
-rw-r--r--src/arc-context.cpp6
-rw-r--r--src/pen-context.cpp7
-rw-r--r--src/rect-context.cpp4
-rw-r--r--src/spiral-context.cpp6
-rw-r--r--src/star-context.cpp5
-rw-r--r--src/text-context.cpp3
-rw-r--r--src/zoom-context.cpp1
7 files changed, 21 insertions, 11 deletions
diff --git a/src/arc-context.cpp b/src/arc-context.cpp
index 44c85bf0b..d5a25b61b 100644
--- a/src/arc-context.cpp
+++ b/src/arc-context.cpp
@@ -291,9 +291,11 @@ static gint sp_arc_context_root_handler(SPEventContext *event_context, GdkEvent
SnapManager const &m = desktop->namedview->snap_manager;
motion_dt = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt, ac->item).getPoint();
-
sp_arc_drag(ac, motion_dt, event->motion.state);
+
+ gobble_motion_events(GDK_BUTTON1_MASK);
+
ret = TRUE;
}
break;
@@ -439,7 +441,7 @@ static void sp_arc_drag(SPArcContext *ac, NR::Point pt, guint state)
GString *xs = SP_PX_TO_METRIC_STRING(r.dimensions()[NR::X], desktop->namedview->getDefaultMetric());
GString *ys = SP_PX_TO_METRIC_STRING(r.dimensions()[NR::Y], desktop->namedview->getDefaultMetric());
- ac->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("<b>Ellipse</b>: %s &#215; %s; with <b>Ctrl</b> to make circle or integer-ratio ellipse; with <b>Shift</b> to draw around the starting point"), xs->str, ys->str);
+ ac->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("<b>Ellipse</b>: %s &#215; %s; with <b>Ctrl</b> to make circle or integer-ratio ellipse; with <b>Shift</b> to draw around the starting point"), xs->str, ys->str);
g_string_free(xs, FALSE);
g_string_free(ys, FALSE);
}
diff --git a/src/pen-context.cpp b/src/pen-context.cpp
index 53ee7df6d..76fc3a61b 100644
--- a/src/pen-context.cpp
+++ b/src/pen-context.cpp
@@ -615,6 +615,7 @@ pen_handle_motion_notify(SPPenContext *const pc, GdkEventMotion const &mevent)
spdc_endpoint_snap_handle(pc, p, mevent.state);
spdc_pen_set_ctrl(pc, p, mevent.state);
+ gobble_motion_events(GDK_BUTTON1_MASK);
ret = TRUE;
break;
case SP_PEN_CONTEXT_STOP:
@@ -1097,7 +1098,7 @@ spdc_pen_set_subsequent_point(SPPenContext *const pc, NR::Point const p, bool st
double angle = atan2(rel[NR::Y], rel[NR::X]) * 180 / M_PI;
if (prefs_get_int_attribute("options.compassangledisplay", "value", 0) != 0)
angle = angle_to_compass (angle);
- pc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("<b>%s</b>: angle %3.2f&#176;, distance %s; with <b>Ctrl</b> to snap angle, <b>Enter</b> to finish the path"), is_curve? "Curve segment" : "Line segment", angle, dist->str);
+ pc->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("<b>%s</b>: angle %3.2f&#176;, distance %s; with <b>Ctrl</b> to snap angle, <b>Enter</b> to finish the path"), is_curve? "Curve segment" : "Line segment", angle, dist->str);
g_string_free(dist, FALSE);
}
}
@@ -1122,7 +1123,7 @@ spdc_pen_set_ctrl(SPPenContext *const pc, NR::Point const p, guint const state)
double angle = atan2(rel[NR::Y], rel[NR::X]) * 180 / M_PI;
if (prefs_get_int_attribute("options.compassangledisplay", "value", 0) != 0)
angle = angle_to_compass (angle);
- pc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("<b>Curve handle</b>: angle %3.2f&#176;, length %s; with <b>Ctrl</b> to snap angle"), angle, dist->str);
+ pc->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("<b>Curve handle</b>: angle %3.2f&#176;, length %s; with <b>Ctrl</b> to snap angle"), angle, dist->str);
g_string_free(dist, FALSE);
} else if ( pc->npoints == 5 ) {
@@ -1152,7 +1153,7 @@ spdc_pen_set_ctrl(SPPenContext *const pc, NR::Point const p, guint const state)
double angle = atan2(rel[NR::Y], rel[NR::X]) * 180 / M_PI;
if (prefs_get_int_attribute("options.compassangledisplay", "value", 0) != 0)
angle = angle_to_compass (angle);
- pc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("<b>%s</b>: angle %3.2f&#176;, length %s; with <b>Ctrl</b> to snap angle, with <b>Shift</b> to move this handle only"), is_symm? "Curve handle, symmetric" : "Curve handle", angle, dist->str);
+ pc->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("<b>%s</b>: angle %3.2f&#176;, length %s; with <b>Ctrl</b> to snap angle, with <b>Shift</b> to move this handle only"), is_symm? "Curve handle, symmetric" : "Curve handle", angle, dist->str);
g_string_free(dist, FALSE);
} else {
diff --git a/src/rect-context.cpp b/src/rect-context.cpp
index 71683ec8e..9c25f91c0 100644
--- a/src/rect-context.cpp
+++ b/src/rect-context.cpp
@@ -333,7 +333,7 @@ static gint sp_rect_context_root_handler(SPEventContext *event_context, GdkEvent
motion_dt = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt, rc->item).getPoint();
sp_rect_drag(*rc, motion_dt, event->motion.state);
-
+ gobble_motion_events(GDK_BUTTON1_MASK);
ret = TRUE;
}
break;
@@ -489,7 +489,7 @@ static void sp_rect_drag(SPRectContext &rc, NR::Point const pt, guint state)
// status text
GString *xs = SP_PX_TO_METRIC_STRING(r.dimensions()[NR::X], desktop->namedview->getDefaultMetric());
GString *ys = SP_PX_TO_METRIC_STRING(r.dimensions()[NR::Y], desktop->namedview->getDefaultMetric());
- rc._message_context->setF(Inkscape::NORMAL_MESSAGE, _("<b>Rectangle</b>: %s &#215; %s; with <b>Ctrl</b> to make square or integer-ratio rectangle; with <b>Shift</b> to draw around the starting point"), xs->str, ys->str);
+ rc._message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("<b>Rectangle</b>: %s &#215; %s; with <b>Ctrl</b> to make square or integer-ratio rectangle; with <b>Shift</b> to draw around the starting point"), xs->str, ys->str);
g_string_free(xs, FALSE);
g_string_free(ys, FALSE);
}
diff --git a/src/spiral-context.cpp b/src/spiral-context.cpp
index 4e0fd9878..6dbdb74c9 100644
--- a/src/spiral-context.cpp
+++ b/src/spiral-context.cpp
@@ -293,8 +293,10 @@ sp_spiral_context_root_handler(SPEventContext *event_context, GdkEvent *event)
SnapManager const &m = desktop->namedview->snap_manager;
motion_dt = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt, sc->item).getPoint();
-
sp_spiral_drag(sc, motion_dt, event->motion.state);
+
+ gobble_motion_events(GDK_BUTTON1_MASK);
+
ret = TRUE;
}
break;
@@ -455,7 +457,7 @@ sp_spiral_drag(SPSpiralContext *sc, NR::Point p, guint state)
/* status text */
GString *rads = SP_PX_TO_METRIC_STRING(rad, desktop->namedview->getDefaultMetric());
- sc->_message_context->setF(Inkscape::NORMAL_MESSAGE,
+ sc->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE,
_("<b>Spiral</b>: radius %s, angle %5g&#176;; with <b>Ctrl</b> to snap angle"),
rads->str, sp_round((arg + 2.0*M_PI*spiral->revo)*180/M_PI, 0.0001));
g_string_free(rads, FALSE);
diff --git a/src/star-context.cpp b/src/star-context.cpp
index 385d16d0c..73e230deb 100644
--- a/src/star-context.cpp
+++ b/src/star-context.cpp
@@ -305,6 +305,9 @@ static gint sp_star_context_root_handler(SPEventContext *event_context, GdkEvent
motion_dt = m.freeSnap(Inkscape::Snapper::SNAPPOINT_NODE, motion_dt, sc->item).getPoint();
sp_star_drag (sc, motion_dt, event->motion.state);
+
+ gobble_motion_events(GDK_BUTTON1_MASK);
+
ret = TRUE;
}
break;
@@ -463,7 +466,7 @@ static void sp_star_drag(SPStarContext *sc, NR::Point p, guint state)
/* status text */
GString *rads = SP_PX_TO_METRIC_STRING(r1, desktop->namedview->getDefaultMetric());
- sc->_message_context->setF(Inkscape::NORMAL_MESSAGE,
+ sc->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE,
( sc->isflatsided?
_("<b>Polygon</b>: radius %s, angle %5g&#176;; with <b>Ctrl</b> to snap angle")
: _("<b>Star</b>: radius %s, angle %5g&#176;; with <b>Ctrl</b> to snap angle") ),
diff --git a/src/text-context.cpp b/src/text-context.cpp
index 8f6d6f1e3..3bf9dc5a8 100644
--- a/src/text-context.cpp
+++ b/src/text-context.cpp
@@ -429,6 +429,7 @@ sp_text_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEve
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
}
+ gobble_motion_events(GDK_BUTTON1_MASK);
ret = TRUE;
break;
}
@@ -655,7 +656,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
// status text
GString *xs = SP_PX_TO_METRIC_STRING(fabs((p - tc->p0)[NR::X]), desktop->namedview->getDefaultMetric());
GString *ys = SP_PX_TO_METRIC_STRING(fabs((p - tc->p0)[NR::Y]), desktop->namedview->getDefaultMetric());
- event_context->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("<b>Flowed text frame</b>: %s &#215; %s"), xs->str, ys->str);
+ event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("<b>Flowed text frame</b>: %s &#215; %s"), xs->str, ys->str);
g_string_free(xs, FALSE);
g_string_free(ys, FALSE);
diff --git a/src/zoom-context.cpp b/src/zoom-context.cpp
index 64b468e36..71dca4846 100644
--- a/src/zoom-context.cpp
+++ b/src/zoom-context.cpp
@@ -165,6 +165,7 @@ static gint sp_zoom_context_root_handler(SPEventContext *event_context, GdkEvent
NR::Point const motion_w(event->motion.x, event->motion.y);
NR::Point const motion_dt(desktop->w2d(motion_w));
Inkscape::Rubberband::get()->move(motion_dt);
+ gobble_motion_events(GDK_BUTTON1_MASK);
}
break;