Index: gweather/gweather-applet.c
===================================================================
RCS file: /cvs/gnome/gnome-applets/gweather/gweather-applet.c,v
retrieving revision 1.102
diff -u -p -r1.102 gweather-applet.c
--- gweather/gweather-applet.c	12 Jan 2006 05:48:25 -0000	1.102
+++ gweather/gweather-applet.c	27 Jan 2006 03:52:01 -0000
@@ -21,7 +21,6 @@
 #include <gconf/gconf-client.h>
 #include <gnome.h>
 #include <panel-applet.h>
-#include <libgnomeui/gnome-window-icon.h>
 
 #ifdef HAVE_LIBNOTIFY
 #include <libnotify/notify.h>
@@ -38,10 +37,11 @@
 static void place_widgets (GWeatherApplet *gw_applet)
 {
     GtkRequisition req;
-    int total_size = 0;
+    gint text_size = 0;
     gboolean horizontal = FALSE;
     int panel_size = gw_applet->size;
     const gchar *temp;   
+    gint icon_size;
 	
     switch (gw_applet->orient) {
 	case PANEL_APPLET_ORIENT_LEFT:
@@ -54,21 +54,9 @@ static void place_widgets (GWeatherApple
 	    break;
     }
 
-    /* Create the weather icon */
-    weather_info_get_pixbuf_mini(gw_applet->gweather_info, 
-    				 &(gw_applet->applet_pixbuf));     
-    gw_applet->image = gtk_image_new_from_pixbuf (gw_applet->applet_pixbuf);
-    gtk_image_set_from_pixbuf (GTK_IMAGE (gw_applet->image), 
-    			       gw_applet->applet_pixbuf);
-
-    /* Check the weather icon sizes to determine box layout */
-    if (gw_applet->applet_pixbuf != NULL) {
-        gtk_widget_size_request(gw_applet->image, &req);
-        if (horizontal)
-            total_size += req.height;
-        else
-            total_size += req.width;
-    }
+    /* Clear the box */
+    if (gw_applet->box)
+        gtk_widget_destroy (gw_applet->box);
 
     /* Create the temperature label */
     gw_applet->label = gtk_label_new("0\302\260F");
@@ -81,22 +69,44 @@ static void place_widgets (GWeatherApple
     /* Check the label size to determine box layout */
     gtk_widget_size_request(gw_applet->label, &req);
     if (horizontal)
-        total_size += req.height;
+        text_size += req.height;
     else
-        total_size += req.width;
+        text_size += req.width;
 
-    /* Pack the box */
-    if (gw_applet->box)
-        gtk_widget_destroy (gw_applet->box);
-    
-    if (horizontal && (total_size <= panel_size))
-        gw_applet->box = gtk_vbox_new(FALSE, 0);
-    else if (horizontal && (total_size > panel_size))
-        gw_applet->box = gtk_hbox_new(FALSE, 2);
-    else if (!horizontal && (total_size <= panel_size))
-        gw_applet->box = gtk_hbox_new(FALSE, 2);
-    else 
-        gw_applet->box = gtk_vbox_new(FALSE, 0);
+    /* Check if text will fit with at least a 16x16 icon */
+    if (panel_size - text_size >= 16)
+    {
+        if (horizontal)
+        {
+            gw_applet->box = gtk_vbox_new (FALSE, 0);
+            icon_size = panel_size - text_size;
+        }
+        else
+        {
+            gw_applet->box = gtk_hbox_new (FALSE, 2);
+            icon_size = panel_size - text_size - 2; /* subtract 2 for box spacing */
+        }
+    }
+    else
+    {
+        if (horizontal)
+        {
+            gw_applet->box = gtk_hbox_new (FALSE, 2);
+            icon_size = panel_size - 2; /* subtract 2 for box spacing */
+        }
+        else
+        {
+            gw_applet->box = gtk_vbox_new (FALSE, 0);
+            icon_size = panel_size;
+        }
+    }
+
+    /* Create the weather icon */
+    gw_applet->image = gtk_image_new ();
+    g_object_set (gw_applet->image, 
+    			      "icon-name", weather_info_get_icon_name (gw_applet->gweather_info),
+    			      "pixel-size", icon_size,
+    			      NULL);
 
     /* Rebuild the applet it's visual area */
     gtk_container_add (GTK_CONTAINER (gw_applet->container), gw_applet->box);
@@ -281,7 +291,6 @@ applet_destroy (GtkWidget *widget, GWeat
 void gweather_applet_create (GWeatherApplet *gw_applet)
 {
     GtkTooltips *tooltips;
-    GtkIconInfo *icon_info;
     AtkObject *atk_obj;
 
     gw_applet->about_dialog = NULL;
@@ -301,11 +310,7 @@ void gweather_applet_create (GWeatherApp
     panel_applet_set_background_widget(gw_applet->applet,
                                        GTK_WIDGET(gw_applet->applet));
     
-    icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), "stock_weather-storm", 48, 0);
-    if (icon_info) {
-        gnome_window_icon_set_default_from_file (gtk_icon_info_get_filename (icon_info));
-        gtk_icon_info_free (icon_info);
-    }
+    gtk_window_set_default_icon_name ("stock_weather-storm");
 
     gw_applet->container = gtk_alignment_new (0.5, 0.5, 0, 0);
     gtk_container_add (GTK_CONTAINER (gw_applet->applet), gw_applet->container);
@@ -400,14 +405,8 @@ update_finish (WeatherInfo *info, gpoint
 	     (gw_fault_counter >= MAX_CONSECUTIVE_FAULTS))
     {
 	    gw_fault_counter = 0;
-	    weather_info_get_pixbuf_mini (gw_applet->gweather_info, 
-	    				 &(gw_applet->applet_pixbuf));
-	    gtk_image_set_from_pixbuf (GTK_IMAGE (gw_applet->image), 
-	    			       gw_applet->applet_pixbuf);
-	      
-	    gtk_label_set_text (GTK_LABEL (gw_applet->label), 
-	        		weather_info_get_temp_summary(
-					gw_applet->gweather_info));
+	    
+	    place_widgets (gw_applet);
 	    
 	    s = weather_info_get_weather_summary (gw_applet->gweather_info);
 	    gtk_tooltips_set_tip (gw_applet->tooltips, GTK_WIDGET (
@@ -476,11 +475,10 @@ void gweather_update (GWeatherApplet *gw
 {
     WeatherPrefs prefs;
 
-    weather_info_get_pixbuf_mini(gw_applet->gweather_info, 
-    				 &(gw_applet->applet_pixbuf));
+    g_object_set (gw_applet->image,
+                  "icon-name", weather_info_get_icon_name (gw_applet->gweather_info),
+                  NULL);
 
-    gtk_image_set_from_pixbuf (GTK_IMAGE (gw_applet->image), 
-    			       gw_applet->applet_pixbuf);
     gtk_tooltips_set_tip(gw_applet->tooltips, GTK_WIDGET(gw_applet->applet), 
     			 _("Updating..."), NULL);
 
Index: gweather/gweather-dialog.c
===================================================================
RCS file: /cvs/gnome/gnome-applets/gweather/gweather-dialog.c,v
retrieving revision 1.58
diff -u -p -r1.58 gweather-dialog.c
--- gweather/gweather-dialog.c	12 Dec 2005 00:22:17 -0000	1.58
+++ gweather/gweather-dialog.c	27 Jan 2006 03:52:01 -0000
@@ -443,8 +443,11 @@ void gweather_dialog_create (GWeatherApp
   gtk_box_pack_end (GTK_BOX (cond_hbox), cond_frame_alignment, FALSE, FALSE, 0);
   gtk_container_set_border_width (GTK_CONTAINER (cond_frame_alignment), 2);
 
-  weather_info_get_pixbuf (NULL, &(gw_applet->dialog_pixbuf));
-  gw_applet->cond_image = gtk_image_new_from_pixbuf (gw_applet->dialog_pixbuf);
+  gw_applet->cond_image = gtk_image_new ();
+  g_object_set (gw_applet->cond_image,
+                "icon-name", weather_info_get_icon_name (NULL),
+                "pixel-size", 48,
+                NULL);
   gtk_widget_show (gw_applet->cond_image);
   gtk_container_add (GTK_CONTAINER (cond_frame_alignment), gw_applet->cond_image);
 
@@ -491,7 +494,11 @@ void gweather_dialog_create (GWeatherApp
       gtk_notebook_append_page (GTK_NOTEBOOK (weather_notebook), radar_vbox, radar_note_lbl);
       gtk_container_set_border_width (GTK_CONTAINER (radar_vbox), 6);
 
-      gw_applet->radar_image = gtk_image_new_from_pixbuf (gw_applet->dialog_pixbuf);  /* Tmp hack */
+      gw_applet->radar_image = gtk_image_new ();  /* Tmp hack */
+      g_object_set (gw_applet->radar_image,
+                    "icon-name", weather_info_get_icon_name (gw_applet->gweather_info),
+                    "pixel-size", 48,
+                    NULL);
       
       imagescroll_window = gtk_scrolled_window_new (NULL, NULL);
       gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (imagescroll_window),
@@ -557,7 +564,6 @@ void gweather_dialog_close (GWeatherAppl
     g_return_if_fail(gw_applet->gweather_dialog != NULL);
     gtk_widget_destroy(gw_applet->gweather_dialog);
     gw_applet->gweather_dialog = NULL;
-    gw_applet->dialog_mask = NULL;
 }
 
 void gweather_dialog_display_toggle (GWeatherApplet *gw_applet)
@@ -600,11 +606,10 @@ void gweather_dialog_update (GWeatherApp
     if (!gw_applet->gweather_dialog)
         return;
 
-    /* Update pixbuf */
-    weather_info_get_pixbuf(gw_applet->gweather_info, 
-                            &(gw_applet->dialog_pixbuf));
-    gtk_image_set_from_pixbuf (GTK_IMAGE (gw_applet->cond_image), 
-                               gw_applet->dialog_pixbuf);
+    /* Update icon */
+    g_object_set (gw_applet->cond_image,
+                  "icon-name", weather_info_get_icon_name (gw_applet->gweather_info),
+                  NULL);
 
     /* Update current condition fields and forecast */
     gtk_label_set_text(GTK_LABEL(gw_applet->cond_location), weather_info_get_location_name(gw_applet->gweather_info));
Index: gweather/gweather.h
===================================================================
RCS file: /cvs/gnome/gnome-applets/gweather/gweather.h,v
retrieving revision 1.20
diff -u -p -r1.20 gweather.h
--- gweather/gweather.h	12 Jan 2006 05:48:25 -0000	1.20
+++ gweather/gweather.h	27 Jan 2006 03:52:01 -0000
@@ -87,11 +87,6 @@ struct _GWeatherApplet
 	GtkWidget *cond_image;
 	GtkWidget *forecast_text;
 	GtkWidget *radar_image;
-
-	GdkPixbuf *dialog_pixbuf;
-	GdkBitmap *dialog_mask;
-	GdkPixbuf *applet_pixbuf;
-	GdkBitmap *applet_mask;
 };
 
 G_END_DECLS
Index: libgweather/weather.c
===================================================================
RCS file: /cvs/gnome/gnome-applets/libgweather/weather.c,v
retrieving revision 1.7
diff -u -p -r1.7 weather.c
--- libgweather/weather.c	15 Jan 2006 11:44:57 -0000	1.7
+++ libgweather/weather.c	27 Jan 2006 03:52:05 -0000
@@ -34,8 +34,6 @@
 
 #include <glib/gi18n-lib.h>
 #include <gtk/gtkicontheme.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gdk-pixbuf/gdk-pixbuf-loader.h>
 #include <libgnomevfs/gnome-vfs.h>
 
 #include <libgweather/weather.h>
@@ -991,9 +989,6 @@ gchar *weather_info_get_weather_summary 
 }
 
 
-static GdkPixbuf **weather_pixbufs_mini = NULL;
-static GdkPixbuf **weather_pixbufs = NULL;
-
 enum
 {
 	PIX_UNKNOWN,
@@ -1010,66 +1005,23 @@ enum
 	NUM_PIX
 };
 
-#if 0
-static void
-xpm_to_pixmap (char **xpm_data, GdkPixmap **pixmap, GdkBitmap **mask)
-{
-	GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **)xpm_data);
-
-	*pixmap = NULL;
-	*mask = NULL;
-
-	if (pixbuf != NULL) {
-		gdk_pixbuf_render_pixmap_and_mask (pixbuf, pixmap, mask, 127);
-
-		gdk_pixbuf_unref (pixbuf);
-	}
-}
-#endif
-
-static void init_pixbufs (void)
-{
-    static gboolean initialized = FALSE;
-    GtkIconTheme *icon_theme;
-    static char *icons[NUM_PIX] = {
-      "stock_unknown",
-      "stock_weather-sunny",
-      "stock_weather-few-clouds",
-      "stock_weather-cloudy",
-      "stock_weather-showers",
-      "stock_weather-storm",
-      "stock_weather-snow",
-      "stock_weather-fog",
-      "stock_weather-night-clear",
-      "stock_weather-night-few-clouds"
-    };
-    int idx;
-    
-    if (initialized)
-       return;
-    initialized = TRUE;
-
-    icon_theme = gtk_icon_theme_get_default ();
-
-    weather_pixbufs_mini = g_new(GdkPixbuf *, NUM_PIX);
-    weather_pixbufs = g_new(GdkPixbuf *, NUM_PIX);
-
-    for (idx = 0; idx < NUM_PIX; idx++) {
-        weather_pixbufs_mini[idx] = gtk_icon_theme_load_icon (icon_theme, icons[idx], 16, 0, NULL);
-        weather_pixbufs[idx] = gtk_icon_theme_load_icon (icon_theme, icons[idx], 48, 0, NULL);
-    }
-}
+static const gchar *icon_names[NUM_PIX] = {
+	"stock_unknown",
+	"stock_weather-sunny",
+	"stock_weather-few-clouds",
+	"stock_weather-cloudy",
+	"stock_weather-showers",
+	"stock_weather-storm",
+	"stock_weather-snow",
+	"stock_weather-fog",
+	"stock_weather-night-clear",
+	"stock_weather-night-few-clouds"
+};
 
-void _weather_info_get_pixbuf (WeatherInfo *info, gboolean mini, GdkPixbuf **pixbuf)
+const gchar *weather_info_get_icon_name (WeatherInfo *info)
 {
-    GdkPixbuf **pixbufs;
     gint idx = -1;
 
-    g_return_if_fail(pixbuf != NULL);
-
-    init_pixbufs();
-    pixbufs = mini ? weather_pixbufs_mini : weather_pixbufs;
-
     if (!info || !info->valid) {
         idx = PIX_UNKNOWN;
     } else {
@@ -1170,5 +1122,5 @@ void _weather_info_get_pixbuf (WeatherIn
         }
     }
 
-    *pixbuf = pixbufs[idx];
+    return icon_names[idx];
 }
Index: libgweather/weather.h
===================================================================
RCS file: /cvs/gnome/gnome-applets/libgweather/weather.h,v
retrieving revision 1.5
diff -u -p -r1.5 weather.h
--- libgweather/weather.h	15 Jan 2006 11:44:57 -0000	1.5
+++ libgweather/weather.h	27 Jan 2006 03:52:05 -0000
@@ -152,11 +152,7 @@ GdkPixbufAnimation *	weather_info_get_ra
 const gchar *		weather_info_get_temp_summary	(WeatherInfo *info);
 gchar *			weather_info_get_weather_summary(WeatherInfo *info);
 
-void			_weather_info_get_pixbuf	(WeatherInfo *info,
-							 gboolean mini,
-							 GdkPixbuf **pixbuf);
-#define weather_info_get_pixbuf_mini(info,pixbuf) _weather_info_get_pixbuf((info), TRUE, (pixbuf))
-#define weather_info_get_pixbuf(info,pixbuf) _weather_info_get_pixbuf((info), FALSE, (pixbuf))
+const gchar *		weather_info_get_icon_name	(WeatherInfo *info);
 
 gint			weather_info_next_sun_event	(WeatherInfo *info);
 G_END_DECLS
