Index: panel-applet-frame.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/panel-applet-frame.c,v
retrieving revision 1.136
diff -u -r1.136 panel-applet-frame.c
--- panel-applet-frame.c	2 Feb 2005 09:00:17 -0000	1.136
+++ panel-applet-frame.c	4 Jun 2005 04:38:27 -0000
@@ -54,7 +54,6 @@
 #define PROPERTY_SIZE_HINTS "panel-applet-size-hints"
 #define PROPERTY_LOCKED_DOWN "panel-applet-locked-down"
 
-
 struct _PanelAppletFramePrivate {
 	GNOME_Vertigo_PanelAppletShell  applet_shell;
 	CORBA_Object                    control;
@@ -487,6 +486,9 @@
 				      PanelBackgroundType  type)
 {
 	char *bg_str;
+
+	panel_background_style_widget (&frame->priv->panel->background,
+				       GTK_WIDGET (frame));
 
 	g_return_if_fail (PANEL_IS_APPLET_FRAME (frame));
 	g_return_if_fail (PANEL_IS_WIDGET (GTK_WIDGET (frame)->parent));
Index: panel-background.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/panel-background.c,v
retrieving revision 1.21
diff -u -r1.21 panel-background.c
--- panel-background.c	25 Feb 2005 17:12:58 -0000	1.21
+++ panel-background.c	4 Jun 2005 04:38:27 -0000
@@ -977,3 +977,70 @@
 
 	return retval;
 }
+
+void
+panel_background_style_widget (PanelBackground *background,
+			       GtkWidget       *widget)
+{
+	GtkRcStyle       *rc_style;
+	GtkStyle         *style;
+	const PanelColor *colour;
+	GdkGC            *gc;
+	GdkPixmap        *pixmap;
+	const GdkPixmap  *bg_pixmap;
+
+	/* reset style */
+	gtk_widget_set_style (widget, NULL);
+	rc_style = gtk_rc_style_new ();
+	gtk_widget_modify_style (widget, rc_style);
+	gtk_rc_style_unref (rc_style);
+
+	switch (panel_background_get_type (background)) {
+	case PANEL_BACK_NONE:
+		break;
+	case PANEL_BACK_COLOR:
+		colour = panel_background_get_color (background);
+		if (colour->alpha == 0xffff) {
+			gtk_widget_modify_bg (widget,
+					      GTK_STATE_NORMAL, &(colour->gdk));
+			break;
+		}
+		/* else, we have an image, so don't break */
+	case PANEL_BACK_IMAGE:
+		bg_pixmap = panel_background_get_pixmap (background);
+		if (!bg_pixmap)
+			return;
+
+		gc = gdk_gc_new (widget->window);
+		g_return_if_fail (GDK_IS_GC (gc));
+
+		pixmap = gdk_pixmap_new (widget->window,
+					 widget->allocation.width,
+					 widget->allocation.height,
+					 -1);
+
+		gdk_draw_drawable (GDK_DRAWABLE (pixmap),
+				   gc, 
+				   GDK_DRAWABLE (bg_pixmap),
+				   widget->allocation.x,
+				   widget->allocation.y,
+				   0, 0,
+				   widget->allocation.width,
+				   widget->allocation.height);
+
+		g_object_unref (gc);
+
+		style = gtk_style_copy (widget->style);
+		if (style->bg_pixmap[GTK_STATE_NORMAL])
+			g_object_unref (style->bg_pixmap[GTK_STATE_NORMAL]);
+		style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref (pixmap);
+		gtk_widget_set_style (widget, style);
+		g_object_unref (style);
+
+		g_object_unref (pixmap);
+		break;
+	default:
+		g_assert_not_reached ();
+		break;
+	}
+}
Index: panel-background.h
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/panel-background.h,v
retrieving revision 1.5
diff -u -r1.5 panel-background.h
--- panel-background.h	4 Dec 2004 14:28:55 -0000	1.5
+++ panel-background.h	4 Jun 2005 04:38:28 -0000
@@ -119,6 +119,8 @@
 char *panel_background_make_string       (PanelBackground     *background,
 					  int                  x,
 					  int                  y);
+void  panel_background_style_widget      (PanelBackground     *background,
+                                          GtkWidget           *widget);
 
 PanelBackgroundType  panel_background_get_type   (PanelBackground *background);
 const PanelColor    *panel_background_get_color  (PanelBackground *background);
Index: panel-menu-bar.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/panel-menu-bar.c,v
retrieving revision 1.62
diff -u -r1.62 panel-menu-bar.c
--- panel-menu-bar.c	18 May 2005 14:49:11 -0000	1.62
+++ panel-menu-bar.c	4 Jun 2005 04:38:28 -0000
@@ -114,6 +114,7 @@
 panel_menu_bar_size_allocate (GtkWidget     *widget,
 			      GtkAllocation *allocation)
 {
+	PanelMenuBar *menubar = PANEL_MENU_BAR (widget);
 	GtkAllocation old_allocation;
 
 	old_allocation.x      = widget->allocation.x;
@@ -129,7 +130,8 @@
 	    old_allocation.height == allocation->height)
 		return;
 
-	panel_menu_bar_change_background (PANEL_MENU_BAR (widget));
+	panel_background_style_widget (&menubar->priv->panel->background,
+				       widget);
 }
 
 static void
@@ -323,69 +325,4 @@
 	}
 	gtk_menu_shell_select_item (menu_shell,
 				    gtk_menu_get_attach_widget (menu));
-}
-
-void panel_menu_bar_change_background (PanelMenuBar *menubar)
-{
-	GtkRcStyle       *rc_style;
-	GtkStyle         *style;
-	const PanelColor *color;
-	GdkGC            *gc;
-	GdkPixmap        *pixmap;
-	const GdkPixmap  *bg_pixmap;
-
-	/* reset style */
-	gtk_widget_set_style (GTK_WIDGET (menubar), NULL);
-	rc_style = gtk_rc_style_new ();
-	gtk_widget_modify_style (GTK_WIDGET (menubar), rc_style);
-	gtk_rc_style_unref (rc_style);
-
-	switch (panel_background_get_type (&menubar->priv->panel->background)) {
-	case PANEL_BACK_NONE:
-		break;
-	case PANEL_BACK_COLOR:
-		color = panel_background_get_color (&menubar->priv->panel->background);
-		if (color->alpha == 0xffff) {
-			gtk_widget_modify_bg (GTK_WIDGET (menubar),
-					      GTK_STATE_NORMAL, &(color->gdk));
-			break;
-		}
-		/* else, we have an image, so don't break */
-	case PANEL_BACK_IMAGE:
-		bg_pixmap = panel_background_get_pixmap (&menubar->priv->panel->background);
-		if (!bg_pixmap)
-			return;
-
-		gc = gdk_gc_new (GTK_WIDGET (menubar)->window);
-		g_return_if_fail (GDK_IS_GC (gc));
-
-		pixmap = gdk_pixmap_new (GTK_WIDGET (menubar)->window,
-					 GTK_WIDGET (menubar)->allocation.width,
-					 GTK_WIDGET (menubar)->allocation.height,
-					 -1);
-
-		gdk_draw_drawable (GDK_DRAWABLE (pixmap),
-				   gc, 
-				   GDK_DRAWABLE (bg_pixmap),
-				   GTK_WIDGET (menubar)->allocation.x,
-				   GTK_WIDGET (menubar)->allocation.y,
-				   0, 0,
-				   GTK_WIDGET (menubar)->allocation.width,
-				   GTK_WIDGET (menubar)->allocation.height);
-
-		g_object_unref (gc);
-
-		style = gtk_style_copy (GTK_WIDGET (menubar)->style);
-		if (style->bg_pixmap[GTK_STATE_NORMAL])
-			g_object_unref (style->bg_pixmap[GTK_STATE_NORMAL]);
-		style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref (pixmap);
-		gtk_widget_set_style (GTK_WIDGET (menubar), style);
-		g_object_unref (style);
-
-		g_object_unref (pixmap);
-		break;
-	default:
-		g_assert_not_reached ();
-		break;
-	}
 }
