diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2009-04-19 01:01:03 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2009-04-19 01:01:03 +0000 |
| commit | 675c227dce5631cd94a9b40e0c3635afbcd58db7 (patch) | |
| tree | 4ee9da7da464c47b236ef6ae788b6f1404f6aaa5 /src/ui/widget/dock-item.cpp | |
| parent | Added code to deal with changed icon names. Fixes bug #360964 (diff) | |
| download | inkscape-675c227dce5631cd94a9b40e0c3635afbcd58db7.tar.gz inkscape-675c227dce5631cd94a9b40e0c3635afbcd58db7.zip | |
Handle case when an icon is not populated
(bzr r7737)
Diffstat (limited to 'src/ui/widget/dock-item.cpp')
| -rw-r--r-- | src/ui/widget/dock-item.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ui/widget/dock-item.cpp b/src/ui/widget/dock-item.cpp index 12a0686f0..147bd818d 100644 --- a/src/ui/widget/dock-item.cpp +++ b/src/ui/widget/dock-item.cpp @@ -52,8 +52,15 @@ DockItem::DockItem(Dock& dock, const Glib::ustring& name, const Glib::ustring& l sp_icon_fetch_pixbuf(sp_icon); _icon_pixbuf = Glib::wrap(sp_icon->pb, true); } else if ( GTK_IS_IMAGE(icon->gobj()) ) { - _icon_pixbuf = Gtk::Invisible().render_icon(Gtk::StockID(icon_name), - Gtk::ICON_SIZE_MENU); + GtkStockItem stock; + if ( gtk_stock_lookup( icon_name.c_str(), &stock ) ) { + _icon_pixbuf = Gtk::Invisible().render_icon( Gtk::StockID(icon_name), + Gtk::ICON_SIZE_MENU ); + } else { + // TODO re-work this properly. Anti-crasher "null" icon for the moment + _icon_pixbuf = Gtk::Invisible().render_icon( Gtk::StockID(GTK_STOCK_MISSING_IMAGE), + Gtk::ICON_SIZE_MENU ); + } } delete icon; |
