From eb87dc10b67de267764b3fac83b00b89d93b98ad Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 14 Dec 2007 18:46:47 +0000 Subject: Add default grid settings to Inkscape preferences. (bzr r4230) --- src/ui/widget/preferences-widget.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/ui/widget/preferences-widget.cpp') diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index 243fe029d..29f86745e 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -339,6 +339,23 @@ void PrefEntry::on_changed() } } +void PrefColorPicker::init(const Glib::ustring& label, const std::string& prefs_path, const std::string& attr, + guint32 default_rgba) +{ + _prefs_path = prefs_path; + _attr = attr; + _title = label; + this->setRgba32( prefs_get_int_attribute (_prefs_path.c_str(), _attr.c_str(), (int)default_rgba) ); +} + +void PrefColorPicker::on_changed (guint32 rgba) +{ + if (this->is_visible()) //only take action if the user toggled it + { + prefs_set_int_attribute (_prefs_path.c_str(), _attr.c_str(), (int) rgba); + } +} + } // namespace Widget } // namespace UI } // namespace Inkscape -- cgit v1.2.3