summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-10-04 01:31:27 +0000
committerjabiertxof <jabier.arraiza@marker.es>2015-10-04 01:31:27 +0000
commit6b61296109001d15cd1e2a43c38385b5fdba81c7 (patch)
tree3bbe592b4c5dd4ec4570de70df53709def6db9c2 /src/widgets
parentCrash. Fix for Bug #1404934 (Crash when opening files (Glib::ConvertError exc... (diff)
downloadinkscape-6b61296109001d15cd1e2a43c38385b5fdba81c7.tar.gz
inkscape-6b61296109001d15cd1e2a43c38385b5fdba81c7.zip
Add improvements to measure tool:
more responsive add option to handle only active layer or all add a option to hide/show first and last segment add a option to compute only one global sice (bzr r14393.1.1)
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/measure-toolbar.cpp36
-rw-r--r--src/widgets/toolbox.cpp3
2 files changed, 39 insertions, 0 deletions
diff --git a/src/widgets/measure-toolbar.cpp b/src/widgets/measure-toolbar.cpp
index 5a4785b1f..ca79b5792 100644
--- a/src/widgets/measure-toolbar.cpp
+++ b/src/widgets/measure-toolbar.cpp
@@ -38,6 +38,8 @@
#include "widgets/ege-output-action.h"
#include "preferences.h"
#include "toolbox.h"
+#include "widgets/ink-action.h"
+#include "ui/icon-names.h"
#include "ui/widget/unit-tracker.h"
using Inkscape::UI::Widget::UnitTracker;
@@ -79,6 +81,7 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
g_object_set_data( holder, "tracker", tracker );
EgeAdjustmentAction *eact = 0;
+ Inkscape::IconSize secondarySize = ToolboxFactory::prefToSize("/toolbox/secondary", 1);
/* Font Size */
{
@@ -108,6 +111,39 @@ 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 );
}
+ // ignore_1st_and_last
+ {
+ InkToggleAction* act = ink_toggle_action_new( "MeasureIgnore1stAndLast",
+ _("Ignore first and last"),
+ _("Ignore first and last"),
+ INKSCAPE_ICON("draw-geometry-line-segment"),
+ secondarySize );
+ gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
+ PrefPusher *pusher = new PrefPusher(GTK_TOGGLE_ACTION(act), "/tools/measure/ignore_1st_and_last");
+ g_signal_connect( holder, "destroy", G_CALLBACK(delete_prefspusher), pusher);
+ }
+ // measure imbetweens
+ {
+ InkToggleAction* act = ink_toggle_action_new( "MeasureInBettween",
+ _("Show meassures between items"),
+ _("Show meassures between items"),
+ INKSCAPE_ICON("distribute-randomize"),
+ secondarySize );
+ gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
+ PrefPusher *pusher = new PrefPusher(GTK_TOGGLE_ACTION(act), "/tools/measure/show_in_between");
+ g_signal_connect( holder, "destroy", G_CALLBACK(delete_prefspusher), pusher);
+ }
+ // measure only current layer
+ {
+ InkToggleAction* act = ink_toggle_action_new( "MeasureAllLayers",
+ _("Measure all layers"),
+ _("Measure all layers"),
+ INKSCAPE_ICON("dialog-layers"),
+ secondarySize );
+ gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
+ PrefPusher *pusher = new PrefPusher(GTK_TOGGLE_ACTION(act), "/tools/measure/all_layers");
+ g_signal_connect( holder, "destroy", G_CALLBACK(delete_prefspusher), pusher);
+ }
} // end of sp_measure_toolbox_prep()
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index cdf39e9ef..ba02adb92 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -341,6 +341,9 @@ static gchar const * ui_descr =
" <separator />"
" <toolitem action='measure_units_label' />"
" <toolitem action='MeasureUnitsAction' />"
+ " <toolitem action='MeasureIgnore1stAndLast' />"
+ " <toolitem action='MeasureInBettween' />"
+ " <toolitem action='MeasureAllLayers' />"
" </toolbar>"
" <toolbar name='StarToolbar'>"