summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-10-22 22:24:16 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-10-22 22:24:16 +0000
commit314a6914f1a5862d50a4855e7da6317f9c09fc14 (patch)
treeccddc8c14897aa4b81c50828cb0ec84d93a8fdd0 /src/widgets
parentAdded Scale option (diff)
parentupdate to trunk (diff)
downloadinkscape-314a6914f1a5862d50a4855e7da6317f9c09fc14.tar.gz
inkscape-314a6914f1a5862d50a4855e7da6317f9c09fc14.zip
update to trunk
(bzr r14393.1.28)
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/measure-toolbar.cpp34
-rw-r--r--src/widgets/toolbox.cpp1
2 files changed, 32 insertions, 3 deletions
diff --git a/src/widgets/measure-toolbar.cpp b/src/widgets/measure-toolbar.cpp
index 8d7146a46..0e083924e 100644
--- a/src/widgets/measure-toolbar.cpp
+++ b/src/widgets/measure-toolbar.cpp
@@ -162,6 +162,23 @@ static void toggle_ignore_1st_and_last( GtkToggleAction* act, gpointer data )
}
}
+static void toggle_only_visible( GtkToggleAction* act, gpointer data )
+{
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ gboolean active = gtk_toggle_action_get_active(act);
+ prefs->setInt("/tools/measure/only_visible", active);
+ SPDesktop *desktop = static_cast<SPDesktop *>(data);
+ if ( active ) {
+ desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Show only visible crossings."));
+ } else {
+ desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Show all crossings."));
+ }
+ MeasureTool *mt = get_measure_tool();
+ if (mt) {
+ mt->showCanvasItems();
+ }
+}
+
static void toggle_all_layers( GtkToggleAction* act, gpointer data )
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
@@ -239,9 +256,9 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
eact = create_adjustment_action( "MeasureFontSizeAction",
_("Font Size"), _("Font Size:"),
_("The font size to be used in the measurement labels"),
- "/tools/measure/fontsize", 0.0,
+ "/tools/measure/fontsize", 10.0,
GTK_WIDGET(desktop->canvas), holder, FALSE, NULL,
- 1, 36, 1.0, 4.0,
+ 1.0, 36.0, 1.0, 4.0,
0, 0, 0,
sp_measure_fontsize_value_changed, NULL, 0 , 2);
gtk_action_group_add_action( mainActions, GTK_ACTION(eact));
@@ -312,7 +329,18 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(toggle_ignore_1st_and_last), desktop) ;
gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
}
- /* measure imbetweens */
+ /* only visible */
+ {
+ InkToggleAction* act = ink_toggle_action_new( "MeasureOnlyVisible",
+ _("Only visible intersections"),
+ _("Only visible intersections"),
+ INKSCAPE_ICON("zoom"),
+ secondarySize );
+ gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/measure/only_visible", true) );
+ g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(toggle_only_visible), desktop) ;
+ gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
+ }
+ /* measure imbetweens */
{
InkToggleAction* act = ink_toggle_action_new( "MeasureInBettween",
_("Show measures between items"),
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 5d41d3b10..90103325a 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -349,6 +349,7 @@ static gchar const * ui_descr =
" <toolitem action='MeasureUnitsAction' />"
" <toolitem action='MeasureIgnore1stAndLast' />"
" <toolitem action='MeasureInBettween' />"
+ " <toolitem action='MeasureOnlyVisible' />"
" <toolitem action='MeasureAllLayers' />"
" <toolitem action='MeasureReverse' />"
" <toolitem action='MeasureToGuides' />"