[Xfce4-commits] <xfce4-panel:master> Libxfce4panel: Always try to return an icon.

Nick Schermer noreply at xfce.org
Sun Jul 24 20:50:01 CEST 2011


Updating branch refs/heads/master
         to 389ff734e4cc54c68dd87b884b9b5aa8562e6dae (commit)
       from cc0398cd88c4f0857acf893968a499d1618980d5 (commit)

commit 389ff734e4cc54c68dd87b884b9b5aa8562e6dae
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Jul 24 20:47:59 2011 +0200

    Libxfce4panel: Always try to return an icon.
    
    Better in most cases then no icon.

 libxfce4panel/xfce-panel-convenience.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/libxfce4panel/xfce-panel-convenience.c b/libxfce4panel/xfce-panel-convenience.c
index 149af20..3a76928 100644
--- a/libxfce4panel/xfce-panel-convenience.c
+++ b/libxfce4panel/xfce-panel-convenience.c
@@ -210,6 +210,16 @@ xfce_panel_pixbuf_from_source (const gchar  *source,
         }
     }
 
+  if (G_UNLIKELY (pixbuf == NULL))
+    {
+      if (G_UNLIKELY (icon_theme == NULL))
+        icon_theme = gtk_icon_theme_get_default ();
+
+      /* bit ugly as a fallback, but in most cases better then no icon */
+      pixbuf = gtk_icon_theme_load_icon (icon_theme, GTK_STOCK_MISSING_IMAGE,
+                                         size, GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
+    }
+
   /* scale the pixbug if required */
   if (G_LIKELY (pixbuf != NULL))
     {


More information about the Xfce4-commits mailing list