summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a070b68)
raw | patch | inline | side by side (parent: a070b68)
author | joncruz <joncruz@users.sourceforge.net> | |
Tue, 15 Jul 2008 07:11:23 +0000 (07:11 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Tue, 15 Jul 2008 07:11:23 +0000 (07:11 +0000) |
src/dialogs/layers-panel.cpp | patch | blob | history |
index 7ae4d0a14aa08ffac91d49b93807734758f31e82..6e5271ad156c65282d03ebb7e1d3bbc2b45a143a 100644 (file)
#include <gtk/gtkstock.h>
#include <gtk/gtkmain.h>
+#include <gtkmm/icontheme.h>
+
#include "inkscape.h"
#include "layers-panel.h"
_property_pixbuf_off(*this, "pixbuf_off", Glib::RefPtr<Gdk::Pixbuf>(0))
{
property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE;
+ int phys = sp_icon_get_phys_size((int)Inkscape::ICON_SIZE_DECORATION);
- Gtk::Widget* thingie = sp_icon_get_icon(_pixOnName.c_str(), Inkscape::ICON_SIZE_DECORATION);
- if ( thingie ) {
- if ( SP_IS_ICON(thingie->gobj()) ) {
- SPIcon* icon = SP_ICON(thingie->gobj());
- sp_icon_fetch_pixbuf( icon );
- _property_pixbuf_on = Glib::wrap( icon->pb, true );
- }
- delete thingie;
+ 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();
}
- thingie = sp_icon_get_icon(_pixOffName.c_str(), Inkscape::ICON_SIZE_DECORATION);
- if ( thingie ) {
- if ( SP_IS_ICON(thingie->gobj()) ) {
- SPIcon* icon = SP_ICON(thingie->gobj());
- sp_icon_fetch_pixbuf( icon );
- _property_pixbuf_off = Glib::wrap( icon->pb, true );
- }
- delete thingie;
+
+ 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();
}
+
property_pixbuf() = _property_pixbuf_off.get_value();
}