summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2007-04-11 03:19:06 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2007-04-11 03:19:06 +0000
commit69996a1ead3a85db26af92d14a639da692350532 (patch)
treeb6db6cad70552b06e18ead7875f0b825f08ead2c /src
parentallow MakeOffset to do profiled offset controlled by the distance of each poi... (diff)
downloadinkscape-69996a1ead3a85db26af92d14a639da692350532.tar.gz
inkscape-69996a1ead3a85db26af92d14a639da692350532.zip
trace background button/setting for calligraphy
(bzr r2851)
Diffstat (limited to 'src')
-rw-r--r--src/preferences-skeleton.h2
-rw-r--r--src/widgets/toolbox.cpp18
2 files changed, 19 insertions, 1 deletions
diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h
index c40d0c7da..18df327ef 100644
--- a/src/preferences-skeleton.h
+++ b/src/preferences-skeleton.h
@@ -62,7 +62,7 @@ static char const preferences_skeleton[] =
" </group>\n"
" <eventcontext id=\"calligraphic\" style=\"fill:black;fill-opacity:1;fill-rule:nonzero;stroke:none;\"\n"
" mass=\"0.02\" drag=\"1\" angle=\"30\" width=\"0.15\" thinning=\"0.1\" flatness=\"0.9\" cap_rounding=\"0.0\" usecurrent=\"1\"\n"
-" usepressure=\"0\" usetilt=\"0\" keep_selected=\"1\"/>\n"
+" tracebackground=\"0\" usepressure=\"0\" usetilt=\"0\" keep_selected=\"1\"/>\n"
" <eventcontext id=\"text\" usecurrent=\"0\" gradientdrag=\"1\"\n"
" font_sample=\"AaBbCcIiPpQq12369$\342\202\254\302\242?.;/()\"\n"
" style=\"fill:black;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;font-style:normal;font-weight:normal;font-size:12px;\" selcue=\"1\"/>\n"
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index b630b3626..c3b124fd8 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -2178,6 +2178,11 @@ static void sp_ddc_pressure_state_changed( GtkToggleAction *act, gpointer data )
prefs_set_int_attribute( "tools.calligraphic", "usepressure", gtk_toggle_action_get_active( act ) ? 1 : 0);
}
+static void sp_ddc_trace_background_changed( GtkToggleAction *act, gpointer data )
+{
+ prefs_set_int_attribute( "tools.calligraphic", "tracebackground", gtk_toggle_action_get_active( act ) ? 1 : 0);
+}
+
static void sp_ddc_tilt_state_changed( GtkToggleAction *act, GtkAction *calligraphy_angle )
{
prefs_set_int_attribute( "tools.calligraphic", "usetilt", gtk_toggle_action_get_active( act ) ? 1 : 0 );
@@ -2233,6 +2238,7 @@ sp_calligraphy_toolbox_new(SPDesktop *desktop)
" <toolitem action='WiggleAction' />"
" <toolitem action='MassAction' />"
" <separator />"
+ " <toolitem action='TraceAction' />"
" <toolitem action='PressureAction' />"
" <toolitem action='TiltAction' />"
" <toolitem action='ResetAction' />"
@@ -2369,6 +2375,18 @@ sp_calligraphy_toolbox_new(SPDesktop *desktop)
}
+ /* Trace Background button */
+ {
+ InkToggleAction* act = ink_toggle_action_new( "TraceAction",
+ _("Trace Background"),
+ _("Trace the lightness of the background by the width of the pen (white - minimum width, black - maximum width)"),
+ "trace_background",
+ Inkscape::ICON_SIZE_DECORATION );
+ gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
+ g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_ddc_trace_background_changed), NULL);
+ gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs_get_int_attribute( "tools.calligraphic", "tracebackground", 0 ) );
+ }
+
/* Use Pressure button */
{
InkToggleAction* act = ink_toggle_action_new( "PressureAction",