--- gtk+-2.0.6/gtk/gtknotebook_orig.c Mon May 6 20:03:51 2002 +++ gtk+-2.0.6/gtk/gtknotebook.c Thu Oct 10 14:50:01 2002 @@ -44,7 +44,6 @@ #define NOTEBOOK_INIT_SCROLL_DELAY (200) #define NOTEBOOK_SCROLL_DELAY (100) - enum { SWITCH_PAGE, FOCUS_TAB, @@ -436,6 +435,15 @@ FALSE, G_PARAM_READWRITE)); + 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, + 6, + G_PARAM_READABLE)); + gtk_container_class_install_child_property (container_class, CHILD_PROP_TAB_LABEL, g_param_spec_string ("tab_label", NULL, NULL, @@ -562,6 +570,8 @@ static void gtk_notebook_init (GtkNotebook *notebook) { + guint tmp_tab_offset; + GTK_WIDGET_SET_FLAGS (notebook, GTK_CAN_FOCUS | GTK_RECEIVES_DEFAULT); GTK_WIDGET_SET_FLAGS (notebook, GTK_NO_WINDOW); @@ -1012,8 +1022,9 @@ 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; @@ -1148,6 +1159,7 @@ 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: @@ -1201,6 +1213,7 @@ widget->requisition.height = MAX (widget->requisition.height, vis_pages * tab_max + TAB_OVERLAP); + widget->requisition.height += (tab_offset * 2); break; } } @@ -1399,6 +1412,9 @@ GdkRectangle *rectangle) { GdkRectangle event_window_pos; + 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)) { @@ -1410,11 +1426,11 @@ case GTK_POS_LEFT: case GTK_POS_RIGHT: rectangle->x = event_window_pos.x + (event_window_pos.width - rectangle->width) / 2; - rectangle->y = event_window_pos.y + event_window_pos.height - rectangle->height; + rectangle->y = event_window_pos.y + event_window_pos.height - rectangle->height + tab_offset; break; case GTK_POS_TOP: case GTK_POS_BOTTOM: - rectangle->x = event_window_pos.x + event_window_pos.width - rectangle->width; + rectangle->x = event_window_pos.x + event_window_pos.width - rectangle->width + tab_offset; rectangle->y = event_window_pos.y + (event_window_pos.height - rectangle->height) / 2; break; } @@ -2873,10 +2889,13 @@ 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; @@ -2889,6 +2908,7 @@ container->border_width); /* fall through */ case GTK_POS_TOP: + child_allocation.x += tab_offset; child_allocation.height = notebook->cur_page->requisition.height; break; @@ -2899,6 +2919,7 @@ container->border_width); /* fall through */ case GTK_POS_LEFT: + child_allocation.y += tab_offset; child_allocation.width = notebook->cur_page->requisition.width; break; } @@ -3128,7 +3149,7 @@ n++; } } - tab_space -= allocation->width; + tab_space -= allocation->width - 20; break; case GTK_POS_LEFT: case GTK_POS_RIGHT: