diff options
| author | John Bintz <me@johnbintz.com> | 2007-10-21 12:04:38 +0000 |
|---|---|---|
| committer | johncoswell <johncoswell@users.sourceforge.net> | 2007-10-21 12:04:38 +0000 |
| commit | 0bab68cd24b3bf0176c941dadb6c039a3205d40c (patch) | |
| tree | adcc5b028d5de501db25c2416a4aa1dbd1529a24 /src/extension/paramfloat.cpp | |
| parent | LPE: fix undoing changes to pathparameter on-canvas. (diff) | |
| download | inkscape-0bab68cd24b3bf0176c941dadb6c039a3205d40c.tar.gz inkscape-0bab68cd24b3bf0176c941dadb6c039a3205d40c.zip | |
add precision option to float parameters in extensions
(bzr r3936)
Diffstat (limited to 'src/extension/paramfloat.cpp')
| -rw-r--r-- | src/extension/paramfloat.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/extension/paramfloat.cpp b/src/extension/paramfloat.cpp index 85a0bc4b9..2d41720c9 100644 --- a/src/extension/paramfloat.cpp +++ b/src/extension/paramfloat.cpp @@ -41,6 +41,11 @@ ParamFloat::ParamFloat (const gchar * name, const gchar * guitext, const gchar * if (minval != NULL) _min = atof(minval); + _precision = 1; + const char * precision = xml->attribute("precision"); + if (precision != NULL) + _precision = atoi(precision); + /* We're handling this by just killing both values */ if (_max < _min) { _max = 10.0; @@ -144,7 +149,7 @@ ParamFloat::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::sign hbox->pack_start(*label, true, true); ParamFloatAdjustment * fadjust = Gtk::manage(new ParamFloatAdjustment(this, doc, node, changeSignal)); - Gtk::SpinButton * spin = Gtk::manage(new Gtk::SpinButton(*fadjust, 0.1, 1)); + Gtk::SpinButton * spin = Gtk::manage(new Gtk::SpinButton(*fadjust, 0.1, _precision)); spin->show(); hbox->pack_start(*spin, false, false); |
