[gtk+] Ensure GtkStyleContext is generated on gtk_widget_render_icon_pixbuf()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Ensure GtkStyleContext is generated on gtk_widget_render_icon_pixbuf()
- Date: Mon, 10 Jan 2011 02:53:53 +0000 (UTC)
commit 5c3b49ab14c8556d269d3a4e5bfb7af6e45fd6db
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jan 10 03:41:19 2011 +0100
Ensure GtkStyleContext is generated on gtk_widget_render_icon_pixbuf()
This fixes some warnings seen when this is called early
on non yet styled widgets.
gtk/gtkwidget.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f0c56b4..24cc272 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -9018,23 +9018,20 @@ gtk_widget_render_icon_pixbuf (GtkWidget *widget,
const gchar *stock_id,
GtkIconSize size)
{
- GtkWidgetPrivate *priv;
+ GtkStyleContext *context;
GtkIconSet *icon_set;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
g_return_val_if_fail (stock_id != NULL, NULL);
g_return_val_if_fail (size > GTK_ICON_SIZE_INVALID || size == -1, NULL);
- priv = widget->priv;
-
- gtk_widget_ensure_style (widget);
-
- icon_set = gtk_style_context_lookup_icon_set (priv->context, stock_id);
+ context = gtk_widget_get_style_context (widget);
+ icon_set = gtk_style_context_lookup_icon_set (context, stock_id);
if (icon_set == NULL)
return NULL;
- return gtk_icon_set_render_icon_pixbuf (icon_set, priv->context, size);
+ return gtk_icon_set_render_icon_pixbuf (icon_set, context, size);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]