[network-manager-applet/nma-0-9-8] applet: improve icon size handling



commit b79db3619e1f71d5e4d5ac7d342bedb6cfc30fd2
Author: Sebastian Pipping <sebastian pipping org>
Date:   Mon Apr 8 21:48:23 2013 +0200

    applet: improve icon size handling
    
    Always return an icon of exactly the requested size, and let that size
    be less than 16. Fixes the display in various non-GNOME panels.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698901

 src/applet.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index 5c8d892..5571225 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -3136,7 +3136,7 @@ nma_icon_check_and_load (const char *name, GdkPixbuf **icon, NMApplet *applet)
        /* Try to load the icon; if the load fails, log the problem, and set
         * the icon to the fallback icon if requested.
         */
-       *icon = gtk_icon_theme_load_icon (applet->icon_theme, name, applet->icon_size, 0, &error);
+       *icon = gtk_icon_theme_load_icon (applet->icon_theme, name, applet->icon_size, 
GTK_ICON_LOOKUP_FORCE_SIZE, &error);
        if (!*icon) {
                g_warning ("Icon %s missing: (%d) %s",
                           name,
@@ -3240,13 +3240,13 @@ status_icon_size_changed_cb (GtkStatusIcon *icon,
                              NMApplet *applet)
 {
        if (getenv ("NMA_SIZE_DEBUG")) {
-               g_message ("%s(): status icon size now %d", __func__, size);
+               g_message ("%s(): status icon size %d requested", __func__, size);
        }
 
        /* icon_size may be 0 if for example the panel hasn't given us any space
         * yet.  We'll get resized later, but for now just load the 16x16 icons.
         */
-       applet->icon_size = MAX (16, size);
+       applet->icon_size = size ? size : 16;
 
        nma_icons_reload (applet);
 


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