summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-10-18 11:51:14 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-10-18 11:51:14 +0000
commitaed527316ca2cff495c32f57f68e37cd5b346f12 (patch)
tree699a62ea4886ae334dc02eaa53c06a82531e5818 /src/widgets
parentAdd precision to measure. Also change other scalar widgets to a .2 precision ... (diff)
downloadinkscape-aed527316ca2cff495c32f57f68e37cd5b346f12.tar.gz
inkscape-aed527316ca2cff495c32f57f68e37cd5b346f12.zip
Added Scale option
(bzr r14393.1.27)
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/measure-toolbar.cpp46
-rw-r--r--src/widgets/toolbox.cpp2
2 files changed, 38 insertions, 10 deletions
diff --git a/src/widgets/measure-toolbar.cpp b/src/widgets/measure-toolbar.cpp
index 8256abc76..8d7146a46 100644
--- a/src/widgets/measure-toolbar.cpp
+++ b/src/widgets/measure-toolbar.cpp
@@ -102,6 +102,20 @@ sp_measure_offset_value_changed(GtkAdjustment *adj, GObject *tbl)
}
}
+static void sp_measure_scale_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/scale"),
+ gtk_adjustment_get_value(adj));
+ MeasureTool *mt = get_measure_tool();
+ if (mt) {
+ mt->showCanvasItems();
+ }
+ }
+}
static void
sp_measure_precision_value_changed(GtkAdjustment *adj, GObject *tbl)
@@ -233,7 +247,7 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
gtk_action_group_add_action( mainActions, GTK_ACTION(eact));
}
- // units label
+ /* units label */
{
EgeOutputAction* act = ege_output_action_new( "measure_units_label", _("Units:"), _("The units to be used for the measurements"), 0 );
ege_output_action_set_use_markup( act, TRUE );
@@ -241,7 +255,7 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
}
- // units menu
+ /* units menu */
{
GtkAction* act = tracker->createAction( "MeasureUnitsAction", _("Units:"), _("The units to be used for the measurements") );
g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(measure_unit_changed), holder );
@@ -261,13 +275,25 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
gtk_action_group_add_action( mainActions, GTK_ACTION(eact));
}
+ /* Scale */
+ {
+ eact = create_adjustment_action( "MeasureScaleAction",
+ _("Scale %"), _("Scale %:"),
+ _("Scale the results"),
+ "/tools/measure/scale", 100.0,
+ GTK_WIDGET(desktop->canvas), holder, FALSE, NULL,
+ 0.0, 90000.0, 1.0, 4.0,
+ 0, 0, 0,
+ sp_measure_scale_value_changed, NULL, 0 , 3);
+ gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
+ }
/* Offset */
{
eact = create_adjustment_action( "MeasureOffsetAction",
_("Offset"), _("Offset:"),
_("The offset size"),
- "/tools/measure/offset", 30.0,
+ "/tools/measure/offset", 5.0,
GTK_WIDGET(desktop->canvas), holder, FALSE, NULL,
0.0, 90000.0, 1.0, 4.0,
0, 0, 0,
@@ -275,7 +301,7 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
}
- // ignore_1st_and_last
+ /* ignore_1st_and_last */
{
InkToggleAction* act = ink_toggle_action_new( "MeasureIgnore1stAndLast",
_("Ignore first and last"),
@@ -286,7 +312,7 @@ 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
+ /* measure imbetweens */
{
InkToggleAction* act = ink_toggle_action_new( "MeasureInBettween",
_("Show measures between items"),
@@ -297,7 +323,7 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(toggle_show_in_between), desktop) ;
gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
}
- // measure only current layer
+ /* measure only current layer */
{
InkToggleAction* act = ink_toggle_action_new( "MeasureAllLayers",
_("Measure all layers"),
@@ -308,7 +334,7 @@ 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
+ /* toogle start end */
{
InkAction* act = ink_action_new( "MeasureReverse",
_("Reverse measure"),
@@ -318,7 +344,7 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(sp_reverse_knots), 0 );
gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
}
- //to guides
+ /* to guides */
{
InkAction* act = ink_action_new( "MeasureToGuides",
_("To guides"),
@@ -328,7 +354,7 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(sp_to_guides), 0 );
gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
}
- //to mark dimensions
+ /* to mark dimensions */
{
InkAction* act = ink_action_new( "MeasureMarkDimension",
_("Mark Dimension"),
@@ -338,7 +364,7 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G
g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(sp_to_mark_dimension), 0 );
gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
}
- //to item
+ /* to item */
{
InkAction* act = ink_action_new( "MeasureToItem",
_("Convert to item"),
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index e7dd69a28..5d41d3b10 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -341,6 +341,8 @@ static gchar const * ui_descr =
" <separator />"
" <toolitem action='MeasurePrecisionAction' />"
" <separator />"
+ " <toolitem action='MeasureScaleAction' />"
+ " <separator />"
" <toolitem action='MeasureOffsetAction' />"
" <separator />"
" <toolitem action='measure_units_label' />"