From ae0a08f8986529a81c7bd239c7cde548c8bdacc3 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 5 Oct 2015 20:13:58 +0200 Subject: add reverse to meassure output (bzr r14393.1.8) --- src/widgets/measure-toolbar.cpp | 17 ++++++++++++++++- src/widgets/toolbox.cpp | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/measure-toolbar.cpp b/src/widgets/measure-toolbar.cpp index e3536b6a7..5abd099d6 100644 --- a/src/widgets/measure-toolbar.cpp +++ b/src/widgets/measure-toolbar.cpp @@ -148,7 +148,12 @@ static void toggle_show_in_between( GtkToggleAction* act, gpointer data ) mt->showCanvasItems(); } } - +static void sp_reverse_knots(void){ + MeasureTool *mt = get_measure_tool(); + if (mt) { + mt->reverseKnots(); + } +} void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, GObject* holder) { UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); @@ -221,6 +226,16 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(toggle_all_layers), desktop) ; gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); } + //toogle start end + { + InkAction* act = ink_action_new( "MeasureReverse", + _("Reverse measure"), + _("Reverse measure"), + INKSCAPE_ICON("draw-geometry-mirror"), + secondarySize ); + g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(sp_reverse_knots), 0 ); + gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + } } // end of sp_measure_toolbox_prep() diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index ba02adb92..769829313 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -344,6 +344,7 @@ static gchar const * ui_descr = " " " " " " + " " " " " " -- cgit v1.2.3