summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e149e58)
raw | patch | inline | side by side (parent: e149e58)
author | nicholasbishop <nicholasbishop@users.sourceforge.net> | |
Thu, 26 Jul 2007 09:08:25 +0000 (09:08 +0000) | ||
committer | nicholasbishop <nicholasbishop@users.sourceforge.net> | |
Thu, 26 Jul 2007 09:08:25 +0000 (09:08 +0000) |
If the digits value is set to zero, truncate the value when setting the attribute so it is an int, rather than a double.
src/ui/widget/spin-slider.cpp | patch | blob | history |
index a76f1db4900b0a189b9f6e90b0af95c07d761374..311d09963947f3de684ad72388cacae2b61efabd 100644 (file)
Glib::ustring SpinSlider::get_as_attribute() const
{
- return Glib::Ascii::dtostr((int)_adjustment.get_value());
+ const double val = _adjustment.get_value();
+
+ if(_spin.get_digits() == 0)
+ return Glib::Ascii::dtostr((int)val);
+ else
+ return Glib::Ascii::dtostr(val);
}
void SpinSlider::set_from_attribute(SPObject* o)