summaryrefslogtreecommitdiffstats
path: root/src/widgets/toolbox.cpp
diff options
context:
space:
mode:
authormjwybrow <mjwybrow@users.sourceforge.net>2009-06-12 06:58:57 +0000
committermjwybrow <mjwybrow@users.sourceforge.net>2009-06-12 06:58:57 +0000
commit62ddc777b3d6ba460aa2df733156851a25697721 (patch)
tree0c8a48197c2b4e585f813c66201d06c11039e4ef /src/widgets/toolbox.cpp
parentforce show-as-list for font list (diff)
downloadinkscape-62ddc777b3d6ba460aa2df733156851a25697721.tar.gz
inkscape-62ddc777b3d6ba460aa2df733156851a25697721.zip
Fix a bug where the spinboxes on the connector toolbar did not properly
respond to single clicks of their up and down arrows. (bzr r8053)
Diffstat (limited to 'src/widgets/toolbox.cpp')
-rw-r--r--src/widgets/toolbox.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 135c11ef7..7547b2d7e 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -6842,11 +6842,6 @@ static void sp_connector_path_set_ignore(void)
static void connector_spacing_changed(GtkAdjustment *adj, GObject* tbl)
{
- // quit if run by the _changed callbacks
- if (g_object_get_data( tbl, "freeze" )) {
- return;
- }
-
SPDesktop *desktop = (SPDesktop *) g_object_get_data( tbl, "desktop" );
SPDocument *doc = sp_desktop_document(desktop);
@@ -6857,18 +6852,21 @@ static void connector_spacing_changed(GtkAdjustment *adj, GObject* tbl)
Inkscape::XML::Node *repr = SP_OBJECT_REPR(desktop->namedview);
- if ( repr->attribute("inkscape:connector-spacing") ) {
- gdouble priorValue = gtk_adjustment_get_value(adj);
- sp_repr_get_double( repr, "inkscape:connector-spacing", &priorValue );
- if ( priorValue == gtk_adjustment_get_value(adj) ) {
- return;
- }
- } else if ( adj->value == defaultConnSpacing ) {
+ if ( !repr->attribute("inkscape:connector-spacing") &&
+ ( adj->value == defaultConnSpacing )) {
+ // Don't need to update the repr if the attribute doesn't
+ // exist and it is being set to the default value -- as will
+ // happen at startup.
return;
}
- // in turn, prevent callbacks from responding
- g_object_set_data( tbl, "freeze", GINT_TO_POINTER(TRUE) );
+ // quit if run by the attr_changed listener
+ if (g_object_get_data( tbl, "freeze" )) {
+ return;
+ }
+
+ // in turn, prevent listener from responding
+ g_object_set_data( tbl, "freeze", GINT_TO_POINTER(TRUE));
sp_repr_set_css_double(repr, "inkscape:connector-spacing", adj->value);
SP_OBJECT(desktop->namedview)->updateRepr();
@@ -6888,8 +6886,6 @@ static void connector_spacing_changed(GtkAdjustment *adj, GObject* tbl)
_("Change connector spacing"));
g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
-
- spinbutton_defocus(GTK_OBJECT(tbl));
}
static void sp_connector_graph_layout(void)
@@ -6927,7 +6923,6 @@ static void connector_length_changed(GtkAdjustment *adj, GObject* tbl)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
prefs->setDouble("/tools/connector/length", adj->value);
- spinbutton_defocus(GTK_OBJECT(tbl));
}
static void connector_tb_event_attr_changed(Inkscape::XML::Node *repr,
@@ -6949,6 +6944,9 @@ static void connector_tb_event_attr_changed(Inkscape::XML::Node *repr,
sp_repr_get_double(repr, "inkscape:connector-spacing", &spacing);
gtk_adjustment_set_value(adj, spacing);
+ gtk_adjustment_value_changed(adj);
+
+ spinbutton_defocus(GTK_OBJECT(tbl));
}