Index: gtk/gtkrange.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkrange.c,v
retrieving revision 1.126
diff -u -p -r1.126 gtkrange.c
--- gtk/gtkrange.c	18 May 2006 11:39:42 -0000	1.126
+++ gtk/gtkrange.c	18 May 2006 13:16:34 -0000
@@ -398,6 +398,18 @@ gtk_range_class_init (GtkRangeClass *cla
 							         P_("With this option set to TRUE, sliders will be drawn ACTIVE and with shadow IN while they are dragged"),
 							         FALSE,
 							         GTK_PARAM_READABLE));
+
+  /**
+   * GtkRange:trough-side-details:
+   *
+   * Since: 2.10
+   */
+  gtk_widget_class_install_style_property (widget_class,
+                                           g_param_spec_boolean ("trough-side-details",
+                                                                 _("Trough Side Details"),
+                                                                 _("When TRUE, the parts of the trough on the two sides of the slider are drawn with different details"),
+                                                                 FALSE,
+                                                                 GTK_PARAM_READABLE));
 }
 
 static void
@@ -1167,20 +1179,72 @@ gtk_range_expose (GtkWidget      *widget
   if (gdk_rectangle_intersect (&expose_area, &range->range_rect,
                                &area))
     {
+      gint     x      = (widget->allocation.x + range->range_rect.x +
+                         focus_line_width + focus_padding);
+      gint     y      = (widget->allocation.y + range->range_rect.y +
+                         focus_line_width + focus_padding);
+      gint     width  = (range->range_rect.width -
+                         2 * (focus_line_width + focus_padding));
+      gint     height = (range->range_rect.height -
+                         2 * (focus_line_width + focus_padding));
+      gboolean trough_side_details;
+
       area.x += widget->allocation.x;
       area.y += widget->allocation.y;
-      
-      gtk_paint_box (widget->style,
-                     widget->window,
-                     sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
-                     GTK_SHADOW_IN,
-                     &area, GTK_WIDGET(range), "trough",
-                     widget->allocation.x + range->range_rect.x + focus_line_width + focus_padding,
-                     widget->allocation.y + range->range_rect.y + focus_line_width + focus_padding,
-                     range->range_rect.width - 2 * (focus_line_width + focus_padding),
-                     range->range_rect.height - 2 * (focus_line_width + focus_padding));
-      
-                 
+
+      gtk_widget_style_get (GTK_WIDGET (range),
+                            "trough-side-details", &trough_side_details,
+                            NULL);
+
+      if (! trough_side_details)
+        {
+          gtk_paint_box (widget->style,
+                         widget->window,
+                         sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
+                         GTK_SHADOW_IN,
+                         &area, GTK_WIDGET(range), "trough",
+                         x, y,
+                         width, height);
+        }
+      else
+        {
+	  gint trough_change_pos_x = width;
+	  gint trough_change_pos_y = height;
+
+	  if (range->orientation == GTK_ORIENTATION_HORIZONTAL)
+	    trough_change_pos_x = (range->layout->slider.x +
+                                   range->layout->slider.width / 2 -
+                                   (x - widget->allocation.x));
+	  else
+	    trough_change_pos_y = (range->layout->slider.y +
+                                   range->layout->slider.height / 2 -
+                                   (y - widget->allocation.y));
+
+          gtk_paint_box (widget->style,
+                         widget->window,
+                         sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
+                         GTK_SHADOW_IN,
+                         &area, GTK_WIDGET (range),
+                         should_invert (range) ? "trough-upper" : "trough-lower",
+                         x, y,
+                         trough_change_pos_x, trough_change_pos_y);
+
+	  if (range->orientation == GTK_ORIENTATION_HORIZONTAL)
+	    trough_change_pos_y = 0;
+	  else
+	    trough_change_pos_x = 0;
+
+          gtk_paint_box (widget->style,
+                         widget->window,
+                         sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
+                         GTK_SHADOW_IN,
+                         &area, GTK_WIDGET (range),
+                         should_invert (range) ? "trough-lower" : "trough-upper",
+                         x + trough_change_pos_x, y + trough_change_pos_y,
+                         width - trough_change_pos_x,
+                         height - trough_change_pos_y);
+        }
+
       if (sensitive &&
           GTK_WIDGET_HAS_FOCUS (range))
         gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
