GNOME Bugzilla – Bug 96029
Configurable offset at start and end of notebook tabs
Last modified: 2008-08-16 21:29:26 UTC
Attached is a patch against stock gtk+-2.0.6 that in my opinion makes the tabs on notebooks look better. It adds a configurable offset to the start and end of the tabs. You can change the amount of pixels by changing the widget style property "GtkNotebook::tab_offset" in the gtkrc file or turn the feature off by setting the offset to 0. For an example look at http://lighthouseblue.sourceforge.net/notebook.png . The patch is at http://lighthouseblue.sourceforge.net/gtk+-2.0.6-notebook.patch
Jan, do you still have that patch ? Its no longer available from the URL above...if it is lost, we can close this bug.
Created attachment 16703 [details] [review] Jans patch
=== + 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)); === * Default needs to be 0 or you'll break all existing themes. === + guint tmp_tab_offset; + === * Unused variable === + gtk_widget_style_get (widget, "focus-line-width", &focus_width, "tab_offset", &tab_offset, NULL); === * When getting multiple props, usually break up into multiple lines, here 4 lines. - start/one for focus width/one for tab offset/end. ==== + widget->requisition.width += (tab_offset * 2); [...] + widget->requisition.height += (tab_offset * 2); ==== * No need for parentheses here. === - tab_space -= allocation->width; + tab_space -= allocation->width - 20; break; === * Where's the magic 20 come from? * I'd really like to see an addition to docs/widget-geometry.txt for any widget we are adding style properties to. It's going to be quite a bit of work for GtkNotebook, but the information has to be somewhere for theme authors for the style properties to be useful.
Here is a new version. This is actually tested with the new split arrows and works. I'll need a bit longer for widget-geometry.txt
Created attachment 18426 [details] [review] new patch
Would be cool if notebook tabs could be centered as well. That would allow for better emulation of the Mac OSX interface by using themes. Quite a few gtk/gnome applications seem to be available for OSX nowadays. Dunno if this should go into a new bug ...
Isn't this obsoleted by the arrow-spacing property since 2.10?
Patch 18426 doesn't apply cleanly (parts have been detected as applied already). Reviewing it would take a little while. (Working on http://mail.gnome.org/archives/gtk-devel-list/2007-March/msg00148.html)
As noted in comment #7