GNOME Bugzilla – Bug 659317
[GTK3] Hard to see which sheet tab is selected
Last modified: 2013-04-03 17:52:51 UTC
...when the tabs have colours. Try samples/chart-tests.gnumeric
This looks to be theme dependant. For me, the selected tab is clearly visible all the more so as the background color is visible only for the selected tab (which is a bug in itself).
I am in Morten's boat: the active tab is virtually indistinguishable from the others.
I'm considering it's either a theme or gtk+ bug.
There are things we can do. For example, I'm trying things like this: GnmNotebook tab:active { font: Sans 24; } (In ~/.config/gtk-3.0/gtk.css or in src/widgets/gnm-notebook.c)
This actually looks just fine. Unfortunately we must specify a size here. I would have preferred just to override the weight. GnmNotebook tab { font: Sans 12; } GnmNotebook tab:active { font: Sans Bold 12; }
Is there really a bold version of asian scripts? [If this only works for western latin script then it won't do!]
It should certainly work for anything remotely resembling western scripts, but since it only adds distinction I am not sure if it is critical whether it works for, say, Chinese. If your sheets have Chinese names, then (a) use a theme in which you can tell, (b) get a font with bold characters, or (c) add stuff in gtk.css so you can tell. However, the stuff above only works for me in gtk.css. If I add it in src/widgets/gnm-notebook.c it doesn't do anything. I can add a "background-color: red;" there which does show up and tells me that the problem is font related. This is likely a gtk 3.0.0 bug. Could someone please test this with a newer gtk3? We could, in principle, solve the problem by creating our own widget. I fear this would look outrageously out-of-place in most themes. Unlike LO/OOO we do not have the luxury of having theme authors cater to us.
On my setup, if there is no tab background colour set for the tabs the selected tab is easily recognizable. The themes I have tried all seem to make the tab recognizable by changing the background colour. THe problem appears to occur since we override the background colour. So I think we should do something about that background colour rendering. For selected tabs OOO/LO only colour the bottom edge. This will not work for us since we also support tab text colour so the the text must remain on top of the background colour. So perhaps adding a heavy black (or white depending on tab colour or perhaps in the text colour) bottom edge might emphasize the selected tab.
We might use semi-transparent colors for unselected tabs (alpha = 0.5 or so).
For me adding GnmNotebook tab { font: Sans 12; } GnmNotebook tab:active { font: Sans Bold 12; } to ~/.config/gtk-3.0/gtk.css does _not_ work as desired. The tab that is active when the file is opened is in fact bold _but_ it stays bold when tabs are changed and the newly active tab does _not_ become bold!
Font css handling changed around 3.0.2 which explains the discrepancies between my 3.0.0 and your 3.0.8
Created attachment 197719 [details] [review] proposed patch to gnumeric This patch will render a frame around the selected tab. The non-selected tabs are rendered without frame. I have tried to use two different frame styles for selected and non-selected tabs, but while GtkEntry has a shadow-type property that is advertised to be useful for this, the GtkEntry code is in fact not using that property.
Created attachment 197745 [details] screenshot of my tabs with last patch Andreas, your patch truncates the label. And the background color is still not correct for unselected tabs.
Shouldn't we be able to do this with css? (Assuming we can get gtk to work as advertised.)
@Jean, You are the only one who seems to be missing the background colour fo unselected tabs. So this patch was not intending to address that. If the patch is acceptable in principle I can try to make sure that the labels are not truncated. Apparently gtk does not resize the tabs when the frame is switched on. @Morten: Personally I doubt that this will be fixed in GTK any time soon. So a different solution may be necessary.
Andreas, we should fix both issues at once. I'll propose a patch as soon as possible.
Created attachment 197793 [details] screenshot of my tabs This screen shot shows my tabs.
Created attachment 197849 [details] [review] updates patch This updated patch avoids the undesired truncation when a tab gets active by adding a 2pt border to the unselected tabs.
I am now on gtk 3.2 and (at least with the theme I am using) the selected tab is well visible. Onthe other hand the tab colour is never visible.
and on unselected tabs, the sheet name is truncated
*** Bug 685407 has been marked as a duplicate of this bug. ***
Gtk still (3.6.0) isn't handling this right, but this sniplet can help. It crudely frames the active tab green. GnmNotebook tab:active { background-color: #00dd00; } I have filed bug 691163 against gtk+ for this.
Created attachment 240274 [details] [review] Preliminary patch Very early patch that implements a new widget for this. This has *piles* of issues. 1. Currently no click support on the tabs. 2. No limiting of widths of the button area. 3. The widget needs to be just below the sheet area, ie., the scroll bar needs to move. 4. The add-sheet button should look more like the other buttons. 5. For the currently-selected tab LO doesn't color the whole tab (when a color is set), but adds a thick colored rule below the name. What do we want to do? What does Excel do? 6. This doesn't play well with the GtkPaned it's in. Not sure why. 7. In-tab editing of the name will be history. We need a simple dialog.
Created attachment 240319 [details] [review] Preliminary patch 1. is done. 2. is started. Drawing now relies on clipping instead of drawing order which had problems with alpha!=1. Re. 5, LO seems to do what Excel does. Or the other way around.
Created attachment 240418 [details] [review] Preliminary patch Updated patch that severs the link between GnmNotebookButton and GtkLabel.
8. Sheet drag and drop is currently not functional.
Created attachment 240484 [details] [review] Preliminary patch My suspicions that theming would make this hard to make anything but a GtkLabel inside a notebook tab look right appears to be true. This is an alternate approach.
Created attachment 240489 [details] [review] Preliminary patch Updated patch. Context menu is back. Active tab font is themable.
Created attachment 240518 [details] [review] Updated patch Getting close to committing.
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.