summaryrefslogtreecommitdiffstats
path: root/src/widgets/icon.cpp
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2012-06-24 23:19:00 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2012-06-24 23:19:00 +0000
commit03f70d60a8180b2a12ade8000a5470ff3a8d1e00 (patch)
tree5a4efcadea1bdfa044978b3018ebeb09a6993f25 /src/widgets/icon.cpp
parentUse orientable widgets in GTK+ 3 build (diff)
downloadinkscape-03f70d60a8180b2a12ade8000a5470ff3a8d1e00.tar.gz
inkscape-03f70d60a8180b2a12ade8000a5470ff3a8d1e00.zip
Migrate some widgets to GtkStyleContext
(bzr r11513)
Diffstat (limited to 'src/widgets/icon.cpp')
-rw-r--r--src/widgets/icon.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp
index d78ba01dd..c02f4bceb 100644
--- a/src/widgets/icon.cpp
+++ b/src/widgets/icon.cpp
@@ -281,10 +281,18 @@ gboolean IconImpl::draw(GtkWidget *widget, cairo_t* cr)
gtk_icon_source_set_pixbuf(source, icon->pb);
gtk_icon_source_set_size(source, GTK_ICON_SIZE_SMALL_TOOLBAR); // note: this is boilerplate and not used
gtk_icon_source_set_size_wildcarded(source, FALSE);
+
+#if GTK_CHECK_VERSION(3,0,0)
+ image = gtk_render_icon_pixbuf(gtk_widget_get_style_context(widget),
+ source,
+ (GtkIconSize)-1);
+#else
image = gtk_style_render_icon(gtk_widget_get_style(widget), source,
gtk_widget_get_direction(widget),
(GtkStateType) gtk_widget_get_state(widget),
(GtkIconSize)-1, widget, "gtk-image");
+#endif
+
gtk_icon_source_free(source);
unref_image = true;
}