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 659317 - [GTK3] Hard to see which sheet tab is selected
[GTK3] Hard to see which sheet tab is selected
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: GUI
git master
Other All
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
: 685407 (view as bug list)
Depends on:
Blocks: 655858
 
 
Reported: 2011-09-17 14:26 UTC by Morten Welinder
Modified: 2013-04-03 17:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch to gnumeric (1.77 KB, patch)
2011-09-29 01:09 UTC, Andreas J. Guelzow
none Details | Review
screenshot of my tabs with last patch (5.00 KB, image/png)
2011-09-29 11:39 UTC, Jean Bréfort
  Details
screenshot of my tabs (4.89 KB, image/png)
2011-09-29 17:35 UTC, Andreas J. Guelzow
  Details
updates patch (2.77 KB, patch)
2011-09-30 06:28 UTC, Andreas J. Guelzow
none Details | Review
Preliminary patch (38.40 KB, patch)
2013-04-01 01:36 UTC, Morten Welinder
needs-work Details | Review
Preliminary patch (43.20 KB, patch)
2013-04-01 18:01 UTC, Morten Welinder
needs-work Details | Review
Preliminary patch (47.46 KB, patch)
2013-04-02 17:27 UTC, Morten Welinder
none Details | Review
Preliminary patch (15.09 KB, patch)
2013-04-03 14:37 UTC, Morten Welinder
none Details | Review
Preliminary patch (17.43 KB, patch)
2013-04-03 15:16 UTC, Morten Welinder
none Details | Review
Updated patch (15.21 KB, patch)
2013-04-03 17:32 UTC, Morten Welinder
none Details | Review

Description Morten Welinder 2011-09-17 14:26:06 UTC
...when the tabs have colours.

Try samples/chart-tests.gnumeric
Comment 1 Jean Bréfort 2011-09-19 05:23:21 UTC
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).
Comment 2 Andreas J. Guelzow 2011-09-19 16:43:31 UTC
I am in Morten's boat: the active tab is virtually indistinguishable from the others.
Comment 3 Jean Bréfort 2011-09-19 18:06:08 UTC
I'm considering it's either a theme or gtk+ bug.
Comment 4 Morten Welinder 2011-09-19 18:14:25 UTC
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)
Comment 5 Morten Welinder 2011-09-19 18:19:30 UTC
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;
}
Comment 6 Andreas J. Guelzow 2011-09-20 05:26:37 UTC
Is there really a bold version of asian scripts? [If this only works for western latin script then it won't do!]
Comment 7 Morten Welinder 2011-09-20 15:52:41 UTC
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.
Comment 8 Andreas J. Guelzow 2011-09-20 17:27:43 UTC
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.
Comment 9 Jean Bréfort 2011-09-21 08:21:11 UTC
We might use semi-transparent colors for unselected tabs (alpha = 0.5 or so).
Comment 10 Andreas J. Guelzow 2011-09-21 14:04:30 UTC
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!
Comment 11 Morten Welinder 2011-09-21 15:13:55 UTC
Font css handling changed around 3.0.2 which explains the discrepancies
between my 3.0.0 and your 3.0.8
Comment 12 Andreas J. Guelzow 2011-09-29 01:09:18 UTC
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.
Comment 13 Jean Bréfort 2011-09-29 11:39:28 UTC
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.
Comment 14 Morten Welinder 2011-09-29 14:37:19 UTC
Shouldn't we be able to do this with css?  (Assuming we can get gtk
to work as advertised.)
Comment 15 Andreas J. Guelzow 2011-09-29 17:06:38 UTC
@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.
Comment 16 Jean Bréfort 2011-09-29 17:32:29 UTC
Andreas, we should fix both issues at once. I'll propose a patch as soon as possible.
Comment 17 Andreas J. Guelzow 2011-09-29 17:35:21 UTC
Created attachment 197793 [details]
screenshot of my tabs

This screen shot shows my tabs.
Comment 18 Andreas J. Guelzow 2011-09-30 06:28:30 UTC
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.
Comment 19 Andreas J. Guelzow 2011-11-30 19:59:43 UTC
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.
Comment 20 Andreas J. Guelzow 2011-11-30 20:01:04 UTC
and on unselected tabs, the sheet name is truncated
Comment 21 Andreas J. Guelzow 2012-10-03 18:31:01 UTC
*** Bug 685407 has been marked as a duplicate of this bug. ***
Comment 22 Morten Welinder 2013-01-11 15:08:22 UTC
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.
Comment 23 Morten Welinder 2013-04-01 01:36:06 UTC
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.
Comment 24 Morten Welinder 2013-04-01 18:01:01 UTC
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.
Comment 25 Morten Welinder 2013-04-02 17:27:32 UTC
Created attachment 240418 [details] [review]
Preliminary patch

Updated patch that severs the link between GnmNotebookButton and GtkLabel.
Comment 26 Morten Welinder 2013-04-02 17:28:12 UTC
8. Sheet drag and drop is currently not functional.
Comment 27 Morten Welinder 2013-04-03 14:37:06 UTC
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.
Comment 28 Morten Welinder 2013-04-03 15:16:12 UTC
Created attachment 240489 [details] [review]
Preliminary patch

Updated patch.  Context menu is back.  Active tab font is themable.
Comment 29 Morten Welinder 2013-04-03 17:32:25 UTC
Created attachment 240518 [details] [review]
Updated patch

Getting close to committing.
Comment 30 Morten Welinder 2013-04-03 17:52:51 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.