GNOME Bugzilla – Bug 636470
Can't make a single tab look good
Last modified: 2011-08-09 23:46:19 UTC
I want GtkNotebook's tab bar to automatically behave more like Firefox's (all tabs have a fixed width regardless of their number and the length of their labels, which are ellipsized if necessary), but I can't even force it to do so by changing properties on the fly, let alone have it happen automatically. I'm the developer of roxterm, which is a bit like gnome-terminal. You're probably aware that when a gnome-terminal window contains a single terminal the notebook's tab bar is hidden. This results in resizing when adding and removing tabs, which can cause problems (especially when maximized) so I added an option in roxterm to always show the tab bar even if there's only one tab. To avoid unwanted resizing I've had to make the tab bar scrollable. To deal with very long labels I've also had to make their labels ellipsizable, both to avoid unwanted resizing and to avoid one tab hogging all the space. This is a bit of a problem. If I don't make the notebook homogeneous and/or set "tab-expand" and "tab-fill" to TRUE on all the children they all take up the minimum size possible with their labels fully ellipsized. That's no good. If I do set the above properties to TRUE, that's OK, except that when there's a single tab it takes up the entire width of the window and it looks silly. So I tried setting the properties to FALSE for a single tab and giving its label a fixed width, then changing the properties to TRUE if and when more tabs are added. This doesn't work properly: the labels all fail to ellipsize. For this reason I've chosen a severity level for a bug rather than an enhancement.
I think I was failing to set the tab-expand child properties consistently. It's now working correctly in gtk2 and gtk3.