From: buliabyak Date: Wed, 11 Apr 2007 03:19:06 +0000 (+0000) Subject: trace background button/setting for calligraphy X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=87c8e3cc053539162b8e78994fd2689ff8cb39f1;p=inkscape.git trace background button/setting for calligraphy --- 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[] = " \n" " \n" +" tracebackground=\"0\" usepressure=\"0\" usetilt=\"0\" keep_selected=\"1\"/>\n" " \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) " " " " " " + " " " " " " " " @@ -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",