summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4460f5d)
raw | patch | inline | side by side (parent: 4460f5d)
author | mjwybrow <mjwybrow@users.sourceforge.net> | |
Fri, 12 Jun 2009 06:58:57 +0000 (06:58 +0000) | ||
committer | mjwybrow <mjwybrow@users.sourceforge.net> | |
Fri, 12 Jun 2009 06:58:57 +0000 (06:58 +0000) |
respond to single clicks of their up and down arrows.
src/widgets/toolbox.cpp | patch | blob | history |
index 135c11ef7914c77ff4b779b382b9fbb0c287c607..7547b2d7e1931893820b8926b00b897213dfe18d 100644 (file)
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
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);
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();
_("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)
{
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,
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));
}