summaryrefslogtreecommitdiffstats
path: root/src/widgets/measure-toolbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/measure-toolbar.cpp')
-rw-r--r--src/widgets/measure-toolbar.cpp35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/widgets/measure-toolbar.cpp b/src/widgets/measure-toolbar.cpp
index a619418db..9c782b4b6 100644
--- a/src/widgets/measure-toolbar.cpp
+++ b/src/widgets/measure-toolbar.cpp
@@ -86,6 +86,22 @@ sp_measure_fontsize_value_changed(GtkAdjustment *adj, GObject *tbl)
}
}
+static void
+sp_measure_offset_value_changed(GtkAdjustment *adj, GObject *tbl)
+{
+ SPDesktop *desktop = static_cast<SPDesktop *>(g_object_get_data( tbl, "desktop" ));
+
+ if (DocumentUndo::getUndoSensitive(desktop->getDocument())) {
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ prefs->setInt(Glib::ustring("/tools/measure/offset"),
+ gtk_adjustment_get_value(adj));
+ MeasureTool *mt = get_measure_tool();
+ if (mt) {
+ mt->showCanvasItems();
+ }
+ }
+}
+
static void measure_unit_changed(GtkAction* /*act*/, GObject* tbl)
{
UnitTracker* tracker = reinterpret_cast<UnitTracker*>(g_object_get_data(tbl, "tracker"));
@@ -180,13 +196,12 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
_("The font size to be used in the measurement labels"),
"/tools/measure/fontsize", 0.0,
GTK_WIDGET(desktop->canvas), holder, FALSE, NULL,
- 10, 36, 1.0, 4.0,
+ 1, 36, 1.0, 4.0,
0, 0, 0,
sp_measure_fontsize_value_changed);
gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
}
-
// units label
{
EgeOutputAction* act = ege_output_action_new( "measure_units_label", _("Units:"), _("The units to be used for the measurements"), 0 );
@@ -201,6 +216,20 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(measure_unit_changed), holder );
gtk_action_group_add_action( mainActions, act );
}
+
+ /* Offset */
+ {
+ eact = create_adjustment_action( "MeasureOffsetAction",
+ _("Offset"), _("Offset:"),
+ _("The offset size"),
+ "/tools/measure/offset", 30.0,
+ GTK_WIDGET(desktop->canvas), holder, FALSE, NULL,
+ 0.0, 90000.0, 1.0, 4.0,
+ 0, 0, 0,
+ sp_measure_offset_value_changed);
+ gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
+ }
+
// ignore_1st_and_last
{
InkToggleAction* act = ink_toggle_action_new( "MeasureIgnore1stAndLast",
@@ -249,7 +278,7 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
InkAction* act = ink_action_new( "MeasureMarkDimension",
_("Mark Dimension"),
_("Mark Dimension"),
- INKSCAPE_ICON("draw-geometry-mirror"),
+ INKSCAPE_ICON("tool-pointer"),
secondarySize );
g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(sp_to_mark_dimension), 0 );
gtk_action_group_add_action( mainActions, GTK_ACTION(act) );