Index: gtk/gtknotebook.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtknotebook.c,v
retrieving revision 1.161
diff -u -p -r1.161 gtknotebook.c
--- gtk/gtknotebook.c	8 Jul 2003 18:59:16 -0000	1.161
+++ gtk/gtknotebook.c	19 Jul 2003 00:32:13 -0000
@@ -43,7 +43,6 @@
 #define NOTEBOOK_INIT_SCROLL_DELAY (200)
 #define NOTEBOOK_SCROLL_DELAY      (100)
 
-
 enum {
   SWITCH_PAGE,
   FOCUS_TAB,
@@ -467,6 +466,22 @@ gtk_notebook_class_init (GtkNotebookClas
  							 FALSE,
 							 G_PARAM_READWRITE));
 
+  /**
+   * GtkNotebook:tab_offset:
+   *
+   * The number of pixels the first and last tabs are offset from the notebook border.
+   *
+   * Since: 2.4
+   */
+  gtk_widget_class_install_style_property (widget_class,
+					   g_param_spec_uint ("tab_offset",
+							      _("Tab Offset"),
+							      _("Number of pixels the first and last tabs are offset from the notebook border"),
+							      0,
+							      G_MAXUINT,
+							      0,
+							      G_PARAM_READABLE));
+  
   gtk_container_class_install_child_property (container_class,
 					      CHILD_PROP_TAB_LABEL,
 					      g_param_spec_string ("tab_label", 
@@ -1156,8 +1171,12 @@ gtk_notebook_size_request (GtkWidget    
   gboolean switch_page = FALSE;
   gint vis_pages;
   gint focus_width;
+  guint tab_offset;
 
-  gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL);
+  gtk_widget_style_get (widget, 
+			"focus-line-width", &focus_width, 
+			"tab_offset", &tab_offset, 
+			NULL);
   
   widget->requisition.width = 0;
   widget->requisition.height = 0;
@@ -1292,6 +1311,7 @@ gtk_notebook_size_request (GtkWidget    
                     widget->requisition.width = MAX (widget->requisition.width,
                                                      tab_width + TAB_OVERLAP);
 
+		  widget->requisition.width += tab_offset * 2;
 		  widget->requisition.height += tab_height;
 		  break;
 		case GTK_POS_LEFT:
@@ -1345,6 +1365,7 @@ gtk_notebook_size_request (GtkWidget    
 		  widget->requisition.height = MAX (widget->requisition.height,
 						    vis_pages * tab_max +
 						    TAB_OVERLAP);
+		  widget->requisition.height += tab_offset * 2;
 		  break;
 		}
 	    }
@@ -1552,6 +1573,9 @@ gtk_notebook_get_arrow_rect (GtkNotebook
   GdkRectangle event_window_pos;
   gboolean before = ARROW_IS_BEFORE (arrow);
   gboolean left = ARROW_IS_LEFT (arrow);
+  guint tab_offset;
+
+  gtk_widget_style_get (GTK_WIDGET (notebook), "tab_offset", &tab_offset, NULL);
 
   if (gtk_notebook_get_event_window_position (notebook, &event_window_pos))
     {
@@ -1569,9 +1593,9 @@ gtk_notebook_get_arrow_rect (GtkNotebook
 	    rectangle->x = event_window_pos.x + event_window_pos.width / 2 - rectangle->width;
 	  else 
 	    rectangle->x = event_window_pos.x + event_window_pos.width / 2;
-	  rectangle->y = event_window_pos.y;
+	  rectangle->y = event_window_pos.y + tab_offset;
 	  if (!before)
-	    rectangle->y += event_window_pos.height - rectangle->height;
+	    rectangle->y += event_window_pos.height - rectangle->height - 2 * tab_offset;
 	  break;
 	case GTK_POS_TOP:
 	case GTK_POS_BOTTOM:
@@ -1581,6 +1605,7 @@ gtk_notebook_get_arrow_rect (GtkNotebook
 		rectangle->x = event_window_pos.x;
 	      else
 		rectangle->x = event_window_pos.x + rectangle->width;
+	      rectangle->x += tab_offset;
 	    }
 	  else
 	    {
@@ -1588,6 +1613,7 @@ gtk_notebook_get_arrow_rect (GtkNotebook
 		rectangle->x = event_window_pos.x + event_window_pos.width - rectangle->width;
 	      else
 		rectangle->x = event_window_pos.x + event_window_pos.width - 2 * rectangle->width;
+	      rectangle->x -= tab_offset;
 	    }
 	  rectangle->y = event_window_pos.y + (event_window_pos.height - rectangle->height) / 2;
 	  break;
@@ -3051,10 +3077,13 @@ gtk_notebook_pages_allocate (GtkNotebook
   gint n = 1;
   gint old_fill = 0;
   gint new_fill = 0;
+  guint tab_offset;
 
   if (!notebook->show_tabs || !notebook->children || !notebook->cur_page)
     return;
 
+  gtk_widget_style_get (GTK_WIDGET (notebook), "tab_offset", &tab_offset, NULL);
+
   child_allocation.x = widget->allocation.x + container->border_width;
   child_allocation.y = widget->allocation.y + container->border_width;
 
@@ -3067,6 +3096,7 @@ gtk_notebook_pages_allocate (GtkNotebook
 			    container->border_width);
       /* fall through */
     case GTK_POS_TOP:
+      child_allocation.x += tab_offset;
       child_allocation.height = notebook->cur_page->requisition.height;
       break;
       
@@ -3077,6 +3107,7 @@ gtk_notebook_pages_allocate (GtkNotebook
 			    container->border_width);
       /* fall through */
     case GTK_POS_LEFT:
+      child_allocation.y += tab_offset;
       child_allocation.width = notebook->cur_page->requisition.width;
       break;
     }
@@ -3107,13 +3138,13 @@ gtk_notebook_pages_allocate (GtkNotebook
 		tab_space += page->requisition.width;
 	    }
 	  if (tab_space >
-	      allocation->width - 2 * container->border_width - TAB_OVERLAP) 
+	      allocation->width - 2 * container->border_width - TAB_OVERLAP - 2 * tab_offset) 
 	    {
 	      showarrow = TRUE;
 	      page = focus_tab->data; 
 
-	      tab_space = allocation->width - TAB_OVERLAP -
-		page->requisition.width - 2 * container->border_width;
+	      tab_space = allocation->width - TAB_OVERLAP - 2 * tab_offset
+		- page->requisition.width - 2 * container->border_width;
 	      if (notebook->has_after_previous)
 		tab_space -= ARROW_SPACING + ARROW_SIZE;
 	      if (notebook->has_after_next)
@@ -3141,12 +3172,12 @@ gtk_notebook_pages_allocate (GtkNotebook
 		tab_space += page->requisition.height;
 	    }
 	  if (tab_space >
-	      (allocation->height - 2 * container->border_width - TAB_OVERLAP))
+	      (allocation->height - 2 * container->border_width - TAB_OVERLAP - 2 * tab_offset))
 	    {
 	      showarrow = TRUE;
 	      page = focus_tab->data; 
 	      tab_space = allocation->height
-		- TAB_OVERLAP - 2 * container->border_width
+		- TAB_OVERLAP - 2 * container->border_width - 2 * tab_offset
 		- page->requisition.height;
 	      if (notebook->has_after_previous || notebook->has_after_next)
 		tab_space -= ARROW_SPACING + ARROW_SIZE;
