diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2006-10-21 19:37:30 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2006-10-21 19:37:30 +0000 |
| commit | 6eb19b52704d0b55bf1a5ea4a483431305ed3af0 (patch) | |
| tree | b3d24c3bfc5010728033a36770515344268d9c8c /src/widgets/toolbox.cpp | |
| parent | glass by Andy Fitzsimon (diff) | |
| download | inkscape-6eb19b52704d0b55bf1a5ea4a483431305ed3af0.tar.gz inkscape-6eb19b52704d0b55bf1a5ea4a483431305ed3af0.zip | |
Adding climb and digits properties, key processing and focus handling
(bzr r1820)
Diffstat (limited to 'src/widgets/toolbox.cpp')
| -rw-r--r-- | src/widgets/toolbox.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 8e03e5021..287a45f1a 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -818,6 +818,7 @@ sp_tb_spinbutton( static EgeAdjustmentAction * create_adjustment_action( gchar const *name, gchar const *label, gchar const *tooltip, gchar const *path, gchar const *data, gdouble def, + GtkWidget *focusTarget, GtkWidget *us, GtkWidget *dataKludge, gboolean altx, gchar const *altx_mark, @@ -833,9 +834,15 @@ static EgeAdjustmentAction * create_adjustment_action( gchar const *name, gtk_signal_connect( GTK_OBJECT(adj), "value-changed", GTK_SIGNAL_FUNC(callback), dataKludge ); - EgeAdjustmentAction* act = ege_adjustment_action_new( adj, name, label, tooltip, 0 ); + EgeAdjustmentAction* act = ege_adjustment_action_new( adj, name, label, tooltip, 0, climb, digits ); - gtk_object_set_data( GTK_OBJECT(dataKludge), data, adj ); + if ( focusTarget ) { + ege_adjustment_action_set_focuswidget( act, focusTarget ); + } + + if ( dataKludge ) { + gtk_object_set_data( GTK_OBJECT(dataKludge), data, adj ); + } return act; } @@ -2022,7 +2029,7 @@ static void sp_ddc_tilt_state_changed2( GtkToggleAction *act, GtkAction *calligr { prefs_set_int_attribute( "tools.calligraphic", "usetilt", gtk_toggle_action_get_active( act ) ? 1 : 0 ); - gtk_action_set_sensitive( calligraphy_angle, gtk_toggle_action_get_active( act ) ); + gtk_action_set_sensitive( calligraphy_angle, !gtk_toggle_action_get_active( act ) ); } static void sp_ddc_defaults2(GtkWidget *, GtkWidget *dataKludge) @@ -2191,7 +2198,7 @@ sp_calligraphy_toolbox_new(SPDesktop *desktop) eact = create_adjustment_action( "WidthAction", _("Width:"), _("The width of the calligraphic pen (relative to the visible canvas area)"), "tools.calligraphic", "width", 15, - NULL, holder, TRUE, "altx-calligraphy", + GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "altx-calligraphy", 1, 100, 1.0, 10.0, sp_ddc_width_value_changed2, 0.01, 0, 100 ); gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); @@ -2201,7 +2208,7 @@ sp_calligraphy_toolbox_new(SPDesktop *desktop) eact = create_adjustment_action( "ThinningAction", _("Thinning:"), _("How much velocity thins the stroke (> 0 makes fast strokes thinner, < 0 makes them broader, 0 makes width independent of velocity)"), "tools.calligraphic", "thinning", 0.1, - NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, -1.0, 1.0, 0.01, 0.1, sp_ddc_velthin_value_changed2, 0.01, 2); gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); @@ -2211,7 +2218,7 @@ sp_calligraphy_toolbox_new(SPDesktop *desktop) eact = create_adjustment_action( "AngleAction", _("Angle:"), _("The angle of the pen's nib (in degrees; 0 = horizontal; has no effect if fixation = 0)"), "tools.calligraphic", "angle", 30, - NULL, holder, TRUE, "calligraphy-angle", + GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "calligraphy-angle", -90.0, 90.0, 1.0, 10.0, sp_ddc_angle_value_changed2, 1, 0 ); gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); @@ -2222,7 +2229,7 @@ sp_calligraphy_toolbox_new(SPDesktop *desktop) eact = create_adjustment_action( "FixationAction", _("Fixation:"), _("Angle behavior (0 = nib always perpendicular to stroke direction, 1 = fixed angle)"), "tools.calligraphic", "flatness", 0.9, - NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, 0.0, 1.0, 0.01, 0.1, sp_ddc_flatness_value_changed2, 0.01, 2 ); gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); @@ -2233,7 +2240,7 @@ sp_calligraphy_toolbox_new(SPDesktop *desktop) eact = create_adjustment_action( "CapRoundingAction", _("Round:"), _("Increase to round the ends of strokes"), "tools.calligraphic", "cap_rounding", 0.0, - NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, 0.0, 1.0, 0.01, 0.1, sp_ddc_cap_rounding_value_changed2, 0.01, 2 ); gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); @@ -2243,7 +2250,7 @@ sp_calligraphy_toolbox_new(SPDesktop *desktop) eact = create_adjustment_action( "TremorAction", _("Tremor:"), _("Increase to make strokes rugged and trembling"), "tools.calligraphic", "tremor", 0.0, - NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, 0.0, 1.0, 0.01, 0.1, sp_ddc_tremor_value_changed2, 0.01, 2 ); @@ -2254,7 +2261,7 @@ sp_calligraphy_toolbox_new(SPDesktop *desktop) eact = create_adjustment_action( "WiggleAction", _("Wiggle:"), _("Increase to make the pen waver and wiggle"), "tools.calligraphic", "wiggle", 0.0, - NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, 0.0, 1.0, 0.01, 0.1, sp_ddc_wiggle_value_changed2, 0.01, 2 ); gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); @@ -2264,7 +2271,7 @@ sp_calligraphy_toolbox_new(SPDesktop *desktop) eact = create_adjustment_action( "MassAction", _("Mass:"), _("Increase to make the pen drag behind, as if slowed by inertia"), "tools.calligraphic", "mass", 0.02, - NULL, holder, FALSE, NULL, + GTK_WIDGET(desktop->canvas), NULL, holder, FALSE, NULL, 0.0, 1.0, 0.01, 0.1, sp_ddc_mass_value_changed2, 0.01, 2 ); gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); @@ -2292,7 +2299,7 @@ sp_calligraphy_toolbox_new(SPDesktop *desktop) 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_tilt_state_changed2), calligraphy_angle ); - gtk_action_set_sensitive( GTK_ACTION(calligraphy_angle), prefs_get_int_attribute( "tools.calligraphic", "usetilt", 1 ) ); + gtk_action_set_sensitive( GTK_ACTION(calligraphy_angle), !prefs_get_int_attribute( "tools.calligraphic", "usetilt", 1 ) ); gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs_get_int_attribute( "tools.calligraphic", "usetilt", 1 ) ); } |
