summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/imagetoggler.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2009-02-19 23:57:21 +0000
committertweenk <tweenk@users.sourceforge.net>2009-02-19 23:57:21 +0000
commit1bd8104786e988ddbb049246ceab7441a1b54ba7 (patch)
tree38def9e1db2c07c053728276c3d9dee2df429db3 /src/ui/widget/imagetoggler.cpp
parentFix SVN revision reporting so that it doesn't relink on every make (diff)
downloadinkscape-1bd8104786e988ddbb049246ceab7441a1b54ba7.tar.gz
inkscape-1bd8104786e988ddbb049246ceab7441a1b54ba7.zip
Make all icons themable (except the filter icons).
(bzr r7332)
Diffstat (limited to 'src/ui/widget/imagetoggler.cpp')
-rw-r--r--src/ui/widget/imagetoggler.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/ui/widget/imagetoggler.cpp b/src/ui/widget/imagetoggler.cpp
index e3670bd49..961cce5b5 100644
--- a/src/ui/widget/imagetoggler.cpp
+++ b/src/ui/widget/imagetoggler.cpp
@@ -31,19 +31,14 @@ ImageToggler::ImageToggler( char const* on, char const* off) :
{
property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE;
int phys = sp_icon_get_phys_size((int)Inkscape::ICON_SIZE_DECORATION);
+ Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default();
- Glib::RefPtr<Gdk::Pixbuf> pbmm = Gtk::IconTheme::get_default()->load_icon(_pixOnName, phys, (Gtk::IconLookupFlags)0);
- if ( pbmm ) {
- GdkPixbuf* pb = gdk_pixbuf_copy(pbmm->gobj());
- _property_pixbuf_on = Glib::wrap( pb );
- pbmm->unreference();
+ if (icon_theme->has_icon(_pixOnName)) {
+ _property_pixbuf_on = icon_theme->load_icon(_pixOnName, phys, (Gtk::IconLookupFlags)0);
}
- pbmm = Gtk::IconTheme::get_default()->load_icon(_pixOffName, phys, (Gtk::IconLookupFlags)0);
- if ( pbmm ) {
- GdkPixbuf* pb = gdk_pixbuf_copy(pbmm->gobj());
- _property_pixbuf_off = Glib::wrap( pb );
- pbmm->unreference();
+ if (icon_theme->has_icon(_pixOffName)) {
+ _property_pixbuf_off = icon_theme->load_icon(_pixOffName, phys, (Gtk::IconLookupFlags)0);
}
property_pixbuf() = _property_pixbuf_off.get_value();