Index: gtktreeview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeview.c,v
retrieving revision 1.519
diff -u -p -r1.519 gtktreeview.c
--- gtktreeview.c	1 Mar 2006 12:18:57 -0000	1.519
+++ gtktreeview.c	7 Mar 2006 16:10:05 -0000
@@ -767,6 +767,13 @@ gtk_tree_view_class_init (GtkTreeViewCla
 							       GDK_TYPE_COLOR,
 							       GTK_PARAM_READABLE));
 
+  gtk_widget_class_install_style_property (widget_class,
+					   g_param_spec_boolean ("row-ending-details",
+								 P_("Row Ending details"),
+								 P_("Enable extended row background theming"),
+								 FALSE,
+								 GTK_PARAM_READABLE));
+
   /* Signals */
   widget_class->set_scroll_adjustments_signal =
     g_signal_new (I_("set_scroll_adjustments"),
@@ -3511,6 +3518,7 @@ gtk_tree_view_bin_expose (GtkWidget     
   gint n_visible_columns;
   gint pointer_x, pointer_y;
   gboolean got_pointer = FALSE;
+  gboolean row_ending_details;
 
   g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), FALSE);
 
@@ -3523,6 +3531,7 @@ gtk_tree_view_bin_expose (GtkWidget     
 			"vertical-separator", &vertical_separator,
 			"allow-rules", &allow_rules,
 			"focus-line-width", &focus_line_width,
+			"row-ending-details", &row_ending_details,
 			NULL);
 
   if (tree_view->priv->tree == NULL)
@@ -3614,6 +3623,8 @@ gtk_tree_view_bin_expose (GtkWidget     
     {
       gboolean parity;
       gboolean is_separator = FALSE;
+      gboolean is_first = FALSE;
+      gboolean is_last = FALSE;
       
       if (tree_view->priv->row_separator_func)
 	{
@@ -3758,17 +3769,48 @@ gtk_tree_view_bin_expose (GtkWidget     
 	    state = GTK_STATE_NORMAL;
 
 	  /* Draw background */
-          gtk_paint_flat_box (widget->style,
-                              event->window,
-			      state,
-                              GTK_SHADOW_NONE,
-                              &event->area,
-                              widget,
-                              detail,
-                              background_area.x,
-                              background_area.y,
-                              background_area.width,
-                              background_area.height);
+	  if (row_ending_details)
+	    {
+	      char new_detail[128];
+
+	      is_first = (rtl ? !list->next : !list->prev);
+	      is_last = (rtl ? !list->prev : !list->next);
+
+	      if (is_first && is_last)
+		snprintf (new_detail, 127, "%s", detail);
+	      else if (is_first)
+		snprintf (new_detail, 127, "%s_start", detail);
+	      else if (is_last)
+		snprintf (new_detail, 127, "%s_end", detail);
+	      else
+		snprintf (new_detail, 128, "%s_middle", detail);
+
+	      gtk_paint_flat_box (widget->style,
+				  event->window,
+				  state,
+				  GTK_SHADOW_NONE,
+				  &event->area,
+				  widget,
+				  new_detail,
+				  background_area.x,
+				  background_area.y,
+				  background_area.width,
+				  background_area.height);
+	    }
+	  else
+	    {
+	      gtk_paint_flat_box (widget->style,
+				  event->window,
+				  state,
+				  GTK_SHADOW_NONE,
+				  &event->area,
+				  widget,
+				  detail,
+				  background_area.x,
+				  background_area.y,
+				  background_area.width,
+				  background_area.height);
+	    }
 
 	  if (gtk_tree_view_is_expander_column (tree_view, column) &&
               TREE_VIEW_DRAW_EXPANDERS(tree_view))
@@ -3879,16 +3921,31 @@ gtk_tree_view_bin_expose (GtkWidget     
 		break;
 	      gdk_drawable_get_size (tree_view->priv->bin_window,
 				     &width, NULL);
-	      gtk_paint_focus (widget->style,
-			       tree_view->priv->bin_window,
-			       GTK_WIDGET_STATE (widget),
-			       NULL,
-			       widget,
-			       "treeview-drop-indicator",
-			       0, BACKGROUND_FIRST_PIXEL (tree_view, tree, node)
-			       - focus_line_width / 2,
-			       width, ROW_HEIGHT (tree_view, BACKGROUND_HEIGHT (node))
+
+	      if (row_ending_details)
+		gtk_paint_focus (widget->style,
+			         tree_view->priv->bin_window,
+				 GTK_WIDGET_STATE (widget),
+				 NULL,
+				 widget,
+				 (is_first
+				  ? (is_last ? "treeview-drop-indicator" : "treeview-drop-indicator-left" )
+				  : (is_last ? "treeview-drop-indicator-right" : "tree-view-drop-indicator-middle" )),
+				 0, BACKGROUND_FIRST_PIXEL (tree_view, tree, node)
+				 - focus_line_width / 2,
+				 width, ROW_HEIGHT (tree_view, BACKGROUND_HEIGHT (node))
 			       - focus_line_width + 1);
+	      else
+		gtk_paint_focus (widget->style,
+			         tree_view->priv->bin_window,
+				 GTK_WIDGET_STATE (widget),
+				 NULL,
+				 widget,
+				 "treeview-drop-indicator",
+				 0, BACKGROUND_FIRST_PIXEL (tree_view, tree, node)
+				 - focus_line_width / 2,
+				 width, ROW_HEIGHT (tree_view, BACKGROUND_HEIGHT (node))
+				 - focus_line_width + 1);
               break;
             }
 
@@ -3919,16 +3976,31 @@ gtk_tree_view_bin_expose (GtkWidget     
 
 	  gdk_drawable_get_size (tree_view->priv->bin_window,
 				 &width, NULL);
-	  gtk_paint_focus (widget->style,
-			   tree_view->priv->bin_window,
-			   focus_rect_state,
-			   NULL,
-			   widget,
-			   "treeview",
-			   0,
-			   BACKGROUND_FIRST_PIXEL (tree_view, tree, node),
-			   width,
-			   ROW_HEIGHT (tree_view, BACKGROUND_HEIGHT (node)));
+	  
+	  if (row_ending_details)
+	    gtk_paint_focus (widget->style,
+			     tree_view->priv->bin_window,
+			     focus_rect_state,
+			     NULL,
+			     widget,
+			     (is_first
+			      ? (is_last ? "treeview" : "treeview-left" )
+			      : (is_last ? "treeview-right" : "treeview-middle" )),
+			     0,
+			     BACKGROUND_FIRST_PIXEL (tree_view, tree, node),
+			     width,
+			     ROW_HEIGHT (tree_view, BACKGROUND_HEIGHT (node)));
+	  else
+	    gtk_paint_focus (widget->style,
+			     tree_view->priv->bin_window,
+			     focus_rect_state,
+			     NULL,
+			     widget,
+			     "treeview",
+			     0,
+			     BACKGROUND_FIRST_PIXEL (tree_view, tree, node),
+			     width,
+			     ROW_HEIGHT (tree_view, BACKGROUND_HEIGHT (node)));
 	}
 
       y_offset += max_height;
