Index: gnome-control-center/capplets/background/ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/background/ChangeLog,v
retrieving revision 1.190
diff -u -r1.190 ChangeLog
--- gnome-control-center/capplets/background/ChangeLog	26 Feb 2005 19:15:58 -0000	1.190
+++ gnome-control-center/capplets/background/ChangeLog	5 Jun 2005 12:30:14 -0000
@@ -1,3 +1,13 @@
+2005-04-15  Luca Cavalli  <loopback@slackit.org>
+
+	* Makefile.am: install icon file in $(GNOMECC_PIXMAPS_DIR)
+	* gnome-wp-capplet.h: Store the swap button widget
+	* gnome-wp-capplet.c (wallpaper_properties_init),
+	(gnome_wp_swap_colors): Add an option to swap gradient colors
+	(gnome_wp_shade_type_changed): Show and hide swap button
+
+	Fixes #34498
+
 2005-02-26  Rodney Dawes  <dobey@novell.com>
 
 	* *.[ch]: Update Copyright to include current year
Index: gnome-control-center/capplets/background/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/background/Makefile.am,v
retrieving revision 1.51
diff -u -r1.51 Makefile.am
--- gnome-control-center/capplets/background/Makefile.am	28 Nov 2004 08:14:04 -0000	1.51
+++ gnome-control-center/capplets/background/Makefile.am	5 Jun 2005 12:30:15 -0000
@@ -33,12 +33,16 @@
 gladedir = $(GNOMECC_GLADE_DIR)
 glade_DATA = gnome-background-properties.glade
 
+desktop_iconsdir = $(GNOMECC_PIXMAPS_DIR)
+desktop_icons_DATA = stock-swap-colors-12.png
+
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(WALLPAPER_DATADIR)
 
 EXTRA_DIST = \
 	background.desktop.in.in \
-	$(glade_DATA)
+	$(glade_DATA) \
+	$(desktop_icons_DATA)
 
 CLEANFILES = \
 	$(desktop_in_files) $(desktop_DATA)
Index: gnome-control-center/capplets/background/gnome-background-properties.glade
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/background/gnome-background-properties.glade,v
retrieving revision 1.2
diff -u -r1.2 gnome-background-properties.glade
--- gnome-control-center/capplets/background/gnome-background-properties.glade	17 Feb 2004 19:30:14 -0000	1.2
+++ gnome-control-center/capplets/background/gnome-background-properties.glade	5 Jun 2005 12:30:17 -0000
@@ -462,6 +462,78 @@
 		  <property name="fill">False</property>
 		</packing>
 	      </child>
+
+	      <child>
+		<widget class="GtkButton" id="swap_button">
+		  <property name="visible">False</property>
+		  <property name="can_focus">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+
+		  <child>
+		    <widget class="GtkAlignment" id="alignment2">
+		      <property name="visible">True</property>
+		      <property name="xalign">0.5</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xscale">0</property>
+		      <property name="yscale">0</property>
+		      <property name="top_padding">0</property>
+		      <property name="bottom_padding">0</property>
+		      <property name="left_padding">0</property>
+		      <property name="right_padding">0</property>
+
+		      <child>
+			<widget class="GtkHBox" id="hbox6">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">2</property>
+
+			  <child>
+			    <widget class="GtkImage" id="swap_image">
+			      <property name="visible">True</property>
+			      <property name="xalign">0.5</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="label10">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Swa_p Colors</property>
+			      <property name="use_underline">True</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0.5</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
+			</widget>
+		      </child>
+		    </widget>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
 	    </widget>
 	    <packing>
 	      <property name="padding">0</property>
Index: gnome-control-center/capplets/background/gnome-wp-capplet.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/background/gnome-wp-capplet.c,v
retrieving revision 1.28
diff -u -r1.28 gnome-wp-capplet.c
--- gnome-control-center/capplets/background/gnome-wp-capplet.c	26 Feb 2005 19:15:58 -0000	1.28
+++ gnome-control-center/capplets/background/gnome-wp-capplet.c	5 Jun 2005 12:30:20 -0000
@@ -465,14 +465,17 @@
   case GNOME_WP_SHADE_TYPE_HORIZ:
     item->shade_type = g_strdup ("horizontal-gradient");
     gtk_widget_show (capplet->sc_picker);
+    gtk_widget_show (capplet->swap_button);
     break;
   case GNOME_WP_SHADE_TYPE_VERT:
     item->shade_type = g_strdup ("vertical-gradient");
     gtk_widget_show (capplet->sc_picker);
+    gtk_widget_show (capplet->swap_button);
     break;
   case GNOME_WP_SHADE_TYPE_SOLID:
     item->shade_type = g_strdup ("solid");
     gtk_widget_hide (capplet->sc_picker);
+    gtk_widget_hide (capplet->swap_button);
     break;
   default:
     break;
@@ -558,6 +561,32 @@
   gnome_wp_color_changed (capplet, TRUE);
 }
 
+static void gnome_wp_swap_colors (GtkWidget * widget,
+				  GnomeWPCapplet * capplet) {
+  gushort pred, pgreen, pblue;
+  gushort sred, sgreen, sblue;
+
+  gnome_color_picker_get_i16 (GNOME_COLOR_PICKER (capplet->pc_picker),
+			      &pred,
+			      &pgreen,
+			      &pblue, NULL);
+  gnome_color_picker_get_i16 (GNOME_COLOR_PICKER (capplet->sc_picker),
+			      &sred,
+			      &sgreen,
+			      &sblue, NULL);
+
+  gnome_color_picker_set_i16 (GNOME_COLOR_PICKER (capplet->pc_picker),
+			      sred,
+			      sgreen,
+			      sblue, 65535);
+  gnome_color_picker_set_i16 (GNOME_COLOR_PICKER (capplet->sc_picker),
+			      pred,
+			      pgreen,
+			      pblue, 65535);
+
+  gnome_wp_color_changed (capplet, TRUE);
+}
+
 static void gnome_wp_remove_wallpaper (GtkWidget * widget,
 				       GnomeWPCapplet * capplet) {
   GtkTreeIter iter;
@@ -931,6 +960,7 @@
   GtkWidget * menu, * label;
   GtkWidget * mbox, * mitem;
   GtkWidget * add_button;
+  GtkWidget * swap_image;
   GtkCellRenderer * renderer;
   GtkTreeViewColumn * column;
   GtkTreeSelection * selection;
@@ -1231,7 +1261,15 @@
   capplet->sc_picker = glade_xml_get_widget (dialog,"scpicker");
   g_signal_connect (G_OBJECT (capplet->sc_picker), "color_set",
 		    G_CALLBACK (gnome_wp_scolor_changed), capplet);
-  
+
+  swap_image = glade_xml_get_widget (dialog, "swap_image");
+  gtk_image_set_from_file (GTK_IMAGE (swap_image),
+			   GNOMECC_DATA_DIR "/pixmaps/stock-swap-colors-12.png");
+
+  capplet->swap_button = glade_xml_get_widget (dialog, "swap_button");
+  g_signal_connect (G_OBJECT (capplet->swap_button), "clicked",
+		    G_CALLBACK (gnome_wp_swap_colors), capplet);
+
   g_signal_connect (G_OBJECT (capplet->window), "response",
 		    G_CALLBACK (wallpaper_properties_clicked), capplet);
 
Index: gnome-control-center/capplets/background/gnome-wp-capplet.h
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/background/gnome-wp-capplet.h,v
retrieving revision 1.7
diff -u -r1.7 gnome-wp-capplet.h
--- gnome-control-center/capplets/background/gnome-wp-capplet.h	26 Feb 2005 19:15:58 -0000	1.7
+++ gnome-control-center/capplets/background/gnome-wp-capplet.h	5 Jun 2005 12:30:20 -0000
@@ -63,6 +63,7 @@
   GtkWidget * color_opt;
   GtkWidget * pc_picker;
   GtkWidget * sc_picker;
+  GtkWidget * swap_button;
 
   /* Menu Items for Color Style Options */
   GtkWidget * smenuitem;
