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 743944 - Hyperlinks default color use a dark blue
Hyperlinks default color use a dark blue
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
3.14.x
Other Linux
: Normal minor
: ---
Assigned To: Polari maintainers
Polari maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-03 17:03 UTC by psychoslave
Modified: 2015-02-23 01:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Change the default hyperlink color (881 bytes, patch)
2015-02-03 22:57 UTC, psychoslave
rejected Details | Review
chatView: Use state flags instead of named color for links (1.14 KB, patch)
2015-02-04 09:54 UTC, Florian Müllner
committed Details | Review

Description psychoslave 2015-02-03 17:03:23 UTC
Hyperlinks default color use a dark blue which doesn't provide enough contrast when using adwaita dark as main theme. The gnome default color for links seems to be "#729fcf".

Relevant documentation :
https://wiki.gnome.org/Design/OS/Colors
https://wiki.gnome.org/Design/HIG/Color
Comment 1 Florian Müllner 2015-02-03 21:47:43 UTC
The link color is picked up directly from the theme, so reassigning to Adwaita.
Comment 2 psychoslave 2015-02-03 22:57:01 UTC
Created attachment 296057 [details] [review]
Change the default hyperlink color

Use a lighter blue as default color for hyperlinks, readable with dark
background.
Comment 3 psychoslave 2015-02-03 23:01:38 UTC
There's really a hardcoded 'blue' assignment in the code. The patch above change just that. Now looking at the code this seems to be a fallback default color, so either both the theme and hardcoded value are 'blue', or the code doesn't really get the color from the theme.
Comment 4 Lapo Calamandrei 2015-02-04 09:05:06 UTC
Adwaita doesn't use #729fcf as a link color, but #2a76c6 and #4a90d9 for the dark variant, both provides enough contrast to me, so this doesn't look like an Adwaita bug, we don't export a named color for links though, is that the problem?
Comment 5 psychoslave 2015-02-04 09:43:52 UTC
Looks like it's the problem, indeed.

Here is how polari try to get the color :

        let context = this.widget.get_style_context();
        […]
        let [found, linkColor] = context.lookup_color("link_color");
        if (!found) {
            linkColor = new Gdk.RGBA();
            linkColor.parse('blue');
        }

(I don't know if code pasting is appropriate in bugzilla, tell me if that's not the case)
Comment 6 psychoslave 2015-02-04 09:46:02 UTC
Also, where should one look at to know which color will integrate well in the gnome environment?
Comment 7 Florian Müllner 2015-02-04 09:54:15 UTC
Created attachment 296080 [details] [review]
chatView: Use state flags instead of named color for links

The LINK state flag has replaced the -GtkWidget-link-color property
since 3.12, and the named color was removed from the theme a while
ago.


(In reply to comment #4)
> we don't export a named color for links though, is that the problem?

Yes and no - the theme used to have a named color for links and polari is still using it (or rather: trying to). However there's a new way to get the link color from the style that does not involve named colors, so we just need to start using that and we're good.
Comment 8 Florian Müllner 2015-02-04 09:58:05 UTC
Review of attachment 296057 [details] [review]:

The issue is that the color is not picked up from the theme. The fallback color that is used when the color is not found should match the light theme variant that Polari is using.
Comment 9 psychoslave 2015-02-05 00:08:14 UTC
Review of attachment 296057 [details] [review]:

Works fine for me. I tested with both the default and the dark Adwaita theme. In both case, all looked readable to me.
Comment 10 Florian Müllner 2015-02-05 01:01:45 UTC
Comment on attachment 296057 [details] [review]
Change the default hyperlink color

(In reply to comment #9)
> I tested with both the default and the dark Adwaita theme.
> In both case, all looked readable to me.

Just to clarify: I not did mark the patch as rejected because I was unsure how it looked with either variant, it is simply the wrong approach. The color should be picked up from the theme. The existing code does that, and also has a this-should-never-happen fallback path which uses a fixed color when the look up failed. However due to changes in GTK+, we now *always* hit the fallback path - that's the bug that needs to be fixed, not looking for a fallback color that works better with a particular theme (in hindsight, 'blue' was not the best choice and I should have picked something like 'pink' instead - the actual bug would have been apparent for a long time and probably be fixed by now).
Comment 11 psychoslave 2015-02-05 01:27:41 UTC
That was already clear for me, I didn't expect the patch to be validated as is. I sent a patch as a mean to learn how to use the infrastructure and also I didn't saw your message before I sent it. 

That's your patch that I tested with both theme. Did I reviewed the wrong patch?
Comment 12 Florian Müllner 2015-02-05 01:35:28 UTC
(In reply to comment #11)
> That's your patch that I tested with both theme. Did I reviewed the wrong
> patch?

Eeeeks, I'm sorry for the rant then - you did "un-reject" your own patch and set its status to "reviewed", so I was assuming you were making an argument for going with that approach anyway. My apologies, and thanks for testing!
Comment 13 Florian Müllner 2015-02-23 01:09:59 UTC
Attachment 296080 [details] pushed as 5ee2fa6 - chatView: Use state flags instead of named color for links