[Xfce4-commits] [panel-plugins/xfce4-statusnotifier-plugin] 01/03: Try to load icon with its original size when custom theme path is used

noreply at xfce.org noreply at xfce.org
Sun Sep 10 22:30:06 CEST 2017


This is an automated email from the git hooks/post-receive script.

n   i   n   e   t   l   s       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-statusnotifier-plugin.

commit 72563d96a158e435b42273669fd28568f47b6efd
Author: Viktor Odintsev <ninetls at xfce.org>
Date:   Sun Sep 10 23:12:14 2017 +0300

    Try to load icon with its original size when custom theme path is used
---
 panel-plugin/sn-icon-box.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/sn-icon-box.c b/panel-plugin/sn-icon-box.c
index a51ded0..85670f6 100644
--- a/panel-plugin/sn-icon-box.c
+++ b/panel-plugin/sn-icon-box.c
@@ -253,9 +253,22 @@ sn_icon_box_apply_icon (GtkWidget    *image,
 
       if (work_pixbuf == NULL && icon_theme_from_path != NULL)
         {
+          /* load icon in its real size */
           work_pixbuf = gtk_icon_theme_load_icon (icon_theme_from_path,
                                                   sn_preferred_name (),
-                                                  icon_size, 0, NULL);
+                                                  -1, 0, NULL);
+
+          if (work_pixbuf == NULL ||
+              (gdk_pixbuf_get_width (work_pixbuf) <= 1 || gdk_pixbuf_get_height (work_pixbuf) <= 1))
+            {
+              if (work_pixbuf != NULL)
+                g_object_unref (work_pixbuf);
+
+              /* icon size was incorrect, try to pass the desired icon size */
+              work_pixbuf = gtk_icon_theme_load_icon (icon_theme_from_path,
+                                                      sn_preferred_name (),
+                                                      icon_size, 0, NULL);
+            }
         }
 
       if (work_pixbuf == NULL)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list