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 125250 - Ellipsization for GtkNotebook tab labels
Ellipsization for GtkNotebook tab labels
Product: gtk+
Classification: Platform
Component: Widget: GtkNotebook
Other Windows
: Normal normal
: Small fix
Assigned To: gtk-bugs
: 153792 (view as bug list)
Depends on: 59071
Blocks: 147765 622970
Reported: 2003-10-22 23:53 UTC by Tim Van Wassenhove
Modified: 2018-02-10 04:40 UTC
See Also:
GNOME target: ---
GNOME version: ---

Patch to implement an "ellipsize" property on GtkLabel, using the PangoLayout "ellipsize" property. (8.63 KB, patch)
2004-07-17 02:52 UTC, James Cape
committed Details | Review

Description Tim Van Wassenhove 2003-10-22 23:53:31 UTC
I noticed this while using Gaim. I decided to have all my conversations to 
be added to the same window. Every time a conversation is started, a 
tabbed window is added. And i can navigate with the < and > buttons at the 
end of that tablist.

However, if a tab has such a long name, that it is longer than the 
containing window, the < and > buttons aren't visible anymore.

Placing those < and > buttons before the tabnames, would be more usable.
Comment 1 Matthias Clasen 2003-10-23 22:14:40 UTC
GTK 2.4 allows this via style properties that control the number and
placement of the arrows.
Comment 2 Owen Taylor 2003-11-11 22:19:49 UTC
Moving the arrows isn't the right solution. Better to ellipsize
the huge label and make things fit. See long discussion in bug

I'm going to retitle and leave this open because bug 115931
is a sprawling mess of a bug.
Comment 3 Owen Taylor 2003-11-11 22:20:17 UTC
Sorry, those references were meant to be bug 110540.
Comment 4 James Cape 2004-05-20 05:24:29 UTC
I'd recommend adding a GtkEllipsizeType enum and an "ellipsize-mode" enum
property to GtkLabel (and GtkCellRendererText/Progress, IMO), as this behavior
is useful outside of GtkNotebook.

GtkEllipsizeType {
  GTK_ELLIPSIZE_CUSTOM /* calls a user-supplied function, fallback to NONE */

Doing that nicely (the comments in EEL indicate that EelEllipsizingLabel
doesn't) sounds like the tricky part.
Comment 5 James Cape 2004-07-17 02:52:14 UTC
Created attachment 29596 [details] [review]
Patch to implement an "ellipsize" property on GtkLabel, using the PangoLayout "ellipsize" property.
Comment 6 Anders Carlsson 2004-07-18 15:56:55 UTC
Is it really necessary to add an extra enum? PangoEllipsizeMode already exists,
and GtkLabel already exposes Pango API in gtk_label_set_attributes for example.
Comment 7 James Cape 2004-07-18 20:15:07 UTC
The patch above uses PangoEllipsizeMode directly, no extra enums. I was simply
commenting on what a possible ellipsization enum would entail.
Comment 8 Owen Taylor 2004-07-24 18:35:26 UTC
The label property doesn't resolve the notebook issue at all, since GTK+
doesn't currently have any code to reduce the allocation of notebook
tabs on overflow.

Hmm, what did you make the size request reported for the ellipsized
GtkLabel be? 
Comment 9 James Cape 2004-07-24 19:31:59 UTC
It's currently approximate_char_width() * 3.
Comment 10 Matthias Clasen 2004-07-26 16:36:06 UTC
That does in fact not work very well. If I turn on ellipsization on the labels
in the testgtk notebook tabs, the tabs all shrink to "..." even though there is
enough space ... We probably need to extend the size allocation algorithm to
discriminate between "requested size" and "minimal size" 
Comment 11 Matthias Clasen 2004-12-23 05:20:59 UTC
I think the request-width-chars property should make this work much better.
Comment 12 Matthias Clasen 2005-11-07 04:51:50 UTC
*** Bug 153792 has been marked as a duplicate of this bug. ***
Comment 13 Alexander van Loon 2006-02-11 13:29:47 UTC
I just used Bugzilla's search function and read this bug - - which is marked as a duplicate of this bug.

I think as well that it is extremely annoying behavior in Epiphany that when you have more that 7 tabs open that you have to scroll with < and > to see the other tabs. This way tab browsing is badly usable, scrolling is annoying, I can't see if I opened a new tab if I have a lot of tabs open... so please let GTK shrink tabs and disable the scrolling through tabs.

In my opinion this is a very serious issue, please fix this developers.
Comment 14 Gustavo Noronha (kov) 2011-06-21 16:42:26 UTC
What do you think of applying a solution similar to the one I'm proposing for Evolution's express mode in GtkNotebook itself? Here's the bug:

We would make sure the requested size for the tab label is not bigger than a proportion of the allocation of the notebook, set the request appropriately, and set the label to ellipsisize.
Comment 15 Matthias Clasen 2018-02-10 04:40:14 UTC
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and
still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue
for it.