summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2009-04-25 15:50:06 +0000
committertweenk <tweenk@users.sourceforge.net>2009-04-25 15:50:06 +0000
commit8a149124202ca8c46eb6012ca15cb4f6c02cd866 (patch)
treec663646e43129efe4213528ed3565186c9446da7 /src
parentfix for LP bug 366227 (diff)
downloadinkscape-8a149124202ca8c46eb6012ca15cb4f6c02cd866.tar.gz
inkscape-8a149124202ca8c46eb6012ca15cb4f6c02cd866.zip
Fix missing dock icons (bug #364075)
(bzr r7772)
Diffstat (limited to 'src')
-rw-r--r--src/ui/widget/dock-item.cpp38
1 files changed, 9 insertions, 29 deletions
diff --git a/src/ui/widget/dock-item.cpp b/src/ui/widget/dock-item.cpp
index 147bd818d..f718c669c 100644
--- a/src/ui/widget/dock-item.cpp
+++ b/src/ui/widget/dock-item.cpp
@@ -9,6 +9,9 @@
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
+#include <gtk/gtk.h>
+#include <gtkmm.h>
+
#include "dock-item.h"
#include "desktop.h"
#include "inkscape.h"
@@ -16,11 +19,6 @@
#include "ui/widget/dock.h"
#include "widgets/icon.h"
-#include <gtk/gtk.h>
-
-#include <gtkmm/invisible.h>
-#include <gtkmm/stock.h>
-
namespace Inkscape {
namespace UI {
namespace Widget {
@@ -44,30 +42,12 @@ DockItem::DockItem(Dock& dock, const Glib::ustring& name, const Glib::ustring& l
GDL_DOCK_ITEM_BEH_CANT_DOCK_CENTER);
if (!icon_name.empty()) {
- Gtk::Widget *icon = sp_icon_get_icon(icon_name, Inkscape::ICON_SIZE_MENU);
- if (icon) {
- // check icon type (inkscape, gtk, none)
- if ( SP_IS_ICON(icon->gobj()) ) {
- SPIcon* sp_icon = SP_ICON(icon->gobj());
- sp_icon_fetch_pixbuf(sp_icon);
- _icon_pixbuf = Glib::wrap(sp_icon->pb, true);
- } else if ( GTK_IS_IMAGE(icon->gobj()) ) {
- 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;
-
- _gdl_dock_item =
- gdl_dock_item_new_with_pixbuf_icon(name.c_str(), long_name.c_str(),
- _icon_pixbuf->gobj(), gdl_dock_behavior);
- }
+ int width = 0, height = 0;
+ Gtk::IconSize::lookup(Gtk::ICON_SIZE_MENU, width, height);
+ _icon_pixbuf = Gtk::IconTheme::get_default()->load_icon(icon_name, width);
+ _gdl_dock_item =
+ gdl_dock_item_new_with_pixbuf_icon(name.c_str(), long_name.c_str(),
+ _icon_pixbuf->gobj(), gdl_dock_behavior);
} else {
_gdl_dock_item =
gdl_dock_item_new(name.c_str(), long_name.c_str(), gdl_dock_behavior);