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 783913 - Translucent top-bar unreadable
Translucent top-bar unreadable
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: general
3.25.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2017-06-18 07:30 UTC by Russel Winder
Modified: 2021-07-05 14:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot showing white on light top-bar (2.76 MB, image/png)
2017-06-19 10:38 UTC, Russel Winder
  Details
elementary-os-dark-text (1.44 MB, image/png)
2017-06-20 19:55 UTC, Alessandro Bono
  Details
elementary-os-light-text (1.64 MB, image/png)
2017-06-20 19:57 UTC, Alessandro Bono
  Details
elementary-os-translucent-bar (1.61 MB, image/png)
2017-06-20 19:59 UTC, Alessandro Bono
  Details
common: Use a gradient when free floating (2.27 KB, patch)
2017-09-05 16:43 UTC, Alessandro Bono
none Details | Review
panel: Use a gradient when free floating (17.12 KB, patch)
2017-09-05 16:45 UTC, Alessandro Bono
none Details | Review
panel: Use a gradient when free floating (7.35 KB, patch)
2017-09-07 15:58 UTC, Alessandro Bono
none Details | Review
panel: Use a gradient when free floating (6.89 KB, patch)
2017-09-09 00:11 UTC, Alessandro Bono
none Details | Review

Description Russel Winder 2017-06-18 07:30:54 UTC
The new GNOME Shell with translucent top-bar has recently appeared on Fedora Rawhide. I'm not entirely sure I like it, the argument about apparent screen size doesn't really work for me. However that is not the real issue, the real issue is readability. The black top-bar has white writing and is fairly readable. When the background of the top-bar goes translucent grey, the writing stays white and is unreadable. The writing needs to switch to a fairly dark grey so as to have reasonable contrast with the background, and so make the text readable.
Comment 1 Allan Day 2017-06-19 08:43:10 UTC
Can you please provide a screenshot?
Comment 2 Russel Winder 2017-06-19 10:38:05 UTC
Created attachment 354032 [details]
Screenshot showing white on light top-bar
Comment 3 Allan Day 2017-06-19 11:39:20 UTC
Hmm, yes. In this case it looks like the text shadow and the background colour are at odds with one another.
Comment 4 Florian Müllner 2017-06-19 16:44:12 UTC
(In reply to Russel Winder from comment #0)
> The writing needs to switch to a fairly dark grey so as to have reasonable 
> contrast with the background

No, if there's a contrast issue with text and background, then there's no single text color we can pick to fix it. If the text shadow isn't enough, then there's no way around analyzing the background area underneath the top bar and picking a text color that contrasts sufficiently (within reason of course - if the background is a checkerboard, then we've lost ...)

I know Alessandro had some thoughts on this, so adding him to the CC-list
Comment 5 Allan Day 2017-06-19 18:06:15 UTC
(In reply to Florian Müllner from comment #4)
...
> No, if there's a contrast issue with text and background, then there's no
> single text color we can pick to fix it. If the text shadow isn't enough,
> then there's no way around analyzing the background area underneath the top
> bar and picking a text color that contrasts sufficiently
...

Well, we use text shadows on the lock screen, for the same purpose. The issue is the text shadow in combination with the background colour of the panel itself. I'd be up for either increasing the opacity further, or perhaps even removing it altogether.
Comment 6 Alessandro Bono 2017-06-20 19:53:05 UTC
Elementary OS solves the readability issue by changing the top-bar style depending on the background used. I'll attached three screenshots that show how the top-bar looks depending on the luminance of the background behind the top-bar. We could adjust the shadows depending on the background, or entirely follow the Elementary OS' style approach.
Comment 7 Alessandro Bono 2017-06-20 19:55:54 UTC
Created attachment 354119 [details]
elementary-os-dark-text
Comment 8 Alessandro Bono 2017-06-20 19:57:52 UTC
Created attachment 354120 [details]
elementary-os-light-text
Comment 9 Alessandro Bono 2017-06-20 19:59:34 UTC
Created attachment 354121 [details]
elementary-os-translucent-bar
Comment 10 Allan Day 2017-06-27 10:54:15 UTC
(In reply to Alessandro Bono from comment #6)
> Elementary OS solves the readability issue by changing the top-bar style
> depending on the background used. I'll attached three screenshots that show
> how the top-bar looks depending on the luminance of the background behind
> the top-bar. We could adjust the shadows depending on the background, or
> entirely follow the Elementary OS' style approach.

Thanks Alessandro, that's useful.

The goal of the dynamic top bar background is to:

 1. Create a sense of space when there aren't any maximized windows
 2. Focus windows when they are maximized, by making the top bar blend into the bezel

For 1, more transparency is better, so I'm keen to increase it as much as possible, potentially to the point where it's fully transparent.

I'd thought that using text shadow below the items in the top bar would be enough to distinguish them when the background is transparent. However, that doesn't seem to be the case when the background is light. That would indicate two possible approaches:

 1. Make the items dark, like Elementary does
 2. Increase the opacity of the background colour

I think I'm slightly more in favour of option 2.

Something else that my testing revealed is that we might need to look at hover and active states for the top bar "buttons". A fully transparent background with an active popover attached to it looks a little odd to my eyes.
Comment 11 Alessandro Bono 2017-09-05 16:43:07 UTC
Another solution is to use a gradient. Some WIP patches are coming.
Comment 12 Alessandro Bono 2017-09-05 16:43:47 UTC
Created attachment 359215 [details] [review]
common: Use a gradient when free floating

Also, tweak the shadows as per latest design.
Comment 13 Alessandro Bono 2017-09-05 16:45:29 UTC
Created attachment 359216 [details] [review]
panel: Use a gradient when free floating

Also, update the theme as per latest design.
Comment 14 Florian Müllner 2017-09-07 13:26:48 UTC
Review of attachment 359216 [details] [review]:

::: data/theme/gnome-shell.css
@@ -119,3 @@
 StScrollView.vfade {
   -st-vfade-offset: 68px; }
-

Mmh, different sassc versions? Would be good to keep the noise down here ...

::: js/ui/panel.js
@@ +1041,2 @@
     _updateSolidStyle: function() {
+        let metaBackgroundActor = Main.layoutManager._bgManagers[Main.layoutManager.primaryIndex].backgroundActor;

No poking into private layoutManager properties, sorry.

Maybe a cleaner solution would be to handle the background properties in layoutManager instead? Something along the lines of:

Main.panel.actor.connect('notify::style-class', Lang.bind(this, this._updatePrimaryBackground));

_updatePrimaryBackground: function() {
    let backgroundActor = this._bgManager[this.primaryIndex].backgroundActor;
    if (Main.panel.actor.has_style_class_name('solid')) {
        ...
    } else {
        ...
    }
}

@@ +1044,3 @@
             this._removeStyleClassName('solid');
+            Tweener.addTween(metaBackgroundActor,
+                         { gradient: false,

Booleans aren't animatable - either this turns false the moment the animation starts (which means the animation is pointless), or the opposite tween keeps the property at false until the end of the animation (which means *that* animation is pointless).

What you really want is setting the property to true for either animation, then unset it in an onComplete handler when animating out.
Comment 15 Alessandro Bono 2017-09-07 15:58:47 UTC
Created attachment 359365 [details] [review]
panel: Use a gradient when free floating

Also, update the theme as per latest design.
Comment 16 Florian Müllner 2017-09-07 17:29:15 UTC
Review of attachment 359365 [details] [review]:

::: js/ui/layout.js
@@ +294,3 @@
         Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+        Main.panel.actor.connect('notify::style-class',
+                                 Lang.bind(this, this._updatePrimaryBackground));

We'll also need to initialize the effect correctly (that is: call the handler here), and make sure to update it whenever the primary background actor is recreated.

@@ +320,3 @@
+    _updatePrimaryBackground: function() {
+        let metaBackgroundActor = this._bgManagers[this.primaryIndex].backgroundActor;
+        if(Main.panel.actor.has_style_class_name('solid') || Main.panel.actor.has_style_pseudo_class('overview')) {

Style nit: Missing space after if.

Also not sure about the 'overview' class - the overview uses its own background actor, so what we do to the "normal" background underneat doesn't really matter.

(It does mean that we don't get a correct transition between overview background and normal background unfortunately ...)

@@ +321,3 @@
+        let metaBackgroundActor = this._bgManagers[this.primaryIndex].backgroundActor;
+        if(Main.panel.actor.has_style_class_name('solid') || Main.panel.actor.has_style_pseudo_class('overview')) {
+            metaBackgroundActor.gradient = true;

This is common to both branches, so could just keep this outside the if statement

@@ +328,3 @@
+                               transition: 'easeOutQuad',
+                               onComplete: function() {
+                                   metaBackgroundActor.gradient = false;

We need to make sure that this is never called after the solid style has been removed again, so you should do something like

Tweener.removeTweens(metaBackgroundActor)

before the animations
Comment 17 Alessandro Bono 2017-09-09 00:11:06 UTC
(In reply to Florian Müllner from comment #16)
> [...] and make sure to update it whenever the primary background
> actor is recreated.m
Can you point me to the right way to do this?

> Also not sure about the 'overview' class - the overview uses its own
> background actor, so what we do to the "normal" background underneat doesn't
> really matter.
> 
> (It does mean that we don't get a correct transition between overview
> background and normal background unfortunately ...)
The code for the overview was not working because I didn't connect to the 'notify::pseudo-class' signal. Even if the background actor is not the same, hiding the gradient when we enter in overview mode and show it when we leave the overview mode let us see some parts of the animation. Is it possible to fade the switch between the two background actors? It might improve the situation.
Comment 18 Alessandro Bono 2017-09-09 00:11:39 UTC
Created attachment 359423 [details] [review]
panel: Use a gradient when free floating

Also, update the theme as per latest design.
Comment 19 Florian Müllner 2017-09-20 16:22:56 UTC
*** Bug 787940 has been marked as a duplicate of this bug. ***
Comment 20 el 2017-09-29 10:30:12 UTC
For what it's worth, the analyzing top bar of elementary OS looks absolutely gorgeous to me. I hope it is being considered.
Comment 21 Russel Winder 2017-10-15 12:29:57 UTC
I am currently getting a mid-grey top bar and I think it works very well: I definitely prefer it over the solid black now I have tried it for a while.
Comment 22 Lapo Calamandrei 2017-10-23 15:05:28 UTC
We also have a problem with the button clicked state, which is a blue underline that pretty much vanishes on the default background, any idea about that?
Comment 23 GNOME Infrastructure Team 2021-07-05 14:24:40 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of  gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/

Thank you for your understanding and your help.