[gtk+/gtk-style-context] GtkStyle: Return the default icon set if no context is attached.



commit eb9377f5aac285bc8899505ab6b738f1fd9930bd
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Nov 24 01:13:27 2010 +0100

    GtkStyle: Return the default icon set if no context is attached.

 gtk/gtkstyle.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index cdd1249..ad23f22 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -1007,7 +1007,10 @@ gtk_style_lookup_icon_set (GtkStyle   *style,
 
   priv = GTK_STYLE_GET_PRIVATE (style);
 
-  return gtk_style_context_lookup_icon_set (priv->context, stock_id);
+  if (priv->context)
+    return gtk_style_context_lookup_icon_set (priv->context, stock_id);
+
+  return gtk_icon_factory_lookup_default (stock_id);
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]