From 03f70d60a8180b2a12ade8000a5470ff3a8d1e00 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Mon, 25 Jun 2012 00:19:00 +0100 Subject: Migrate some widgets to GtkStyleContext (bzr r11513) --- src/widgets/icon.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/widgets/icon.cpp') 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; } -- cgit v1.2.3