summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/preferences-widget.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-12-14 18:46:47 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-12-14 18:46:47 +0000
commiteb87dc10b67de267764b3fac83b00b89d93b98ad (patch)
tree4504a1ed05da4a24409af43adfcf6c855ad96cca /src/ui/widget/preferences-widget.cpp
parentupdate to latest 2geom (diff)
downloadinkscape-eb87dc10b67de267764b3fac83b00b89d93b98ad.tar.gz
inkscape-eb87dc10b67de267764b3fac83b00b89d93b98ad.zip
Add default grid settings to Inkscape preferences.
(bzr r4230)
Diffstat (limited to 'src/ui/widget/preferences-widget.cpp')
-rw-r--r--src/ui/widget/preferences-widget.cpp17
1 files changed, 17 insertions, 0 deletions
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