After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 96029 - Configurable offset at start and end of notebook tabs
Configurable offset at start and end of notebook tabs
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkNotebook
2.0.x
Other Linux
: Normal enhancement
: Small API
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2002-10-17 05:51 UTC by Jan Rosczak
Modified: 2008-08-16 21:29 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Jans patch (3.91 KB, patch)
2003-05-21 18:20 UTC, Matthias Clasen
none Details | Review
new patch (6.05 KB, patch)
2003-07-19 00:36 UTC, Matthias Clasen
needs-work Details | Review

Description Jan Rosczak 2002-10-17 05:51:02 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
Comment 1 Matthias Clasen 2003-03-19 22:59:56 UTC
Jan, do you still have that patch ? Its no longer available from the
URL above...if it is lost, we can close this bug.
Comment 2 Matthias Clasen 2003-05-21 18:20:16 UTC
Created attachment 16703 [details] [review]
Jans patch
Comment 3 Owen Taylor 2003-07-18 20:49:50 UTC
===

+  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.
Comment 4 Matthias Clasen 2003-07-19 00:35:52 UTC
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
Comment 5 Matthias Clasen 2003-07-19 00:36:54 UTC
Created attachment 18426 [details] [review]
new patch
Comment 6 Rob Staudinger 2004-09-22 02:37:41 UTC
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 ...
Comment 7 Xan Lopez 2007-05-25 09:34:18 UTC
Isn't this obsoleted by the arrow-spacing property since 2.10?
Comment 8 Philip Withnall 2007-05-26 16:31:03 UTC
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)
Comment 9 Matthias Clasen 2008-08-16 21:29:26 UTC
As noted in comment #7